summaryrefslogtreecommitdiff
path: root/android/Bootstrap
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-19 18:46:34 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-19 18:50:36 +0300
commit07c1b61933c24f9dec0793cf881a2d18baf924ab (patch)
tree618e230b07a34facf48cec718ca0155d48de42bc /android/Bootstrap
parenta88ac708403c03d0f950f09ec29c0d5a1e5a85b4 (diff)
Small refactoring of the Android "desktop app" code, no functional change
Move the native methods out to a separate AppSupport class so that they aren't in our "experimenal" Desktop app's namespace. Don't hardcode the name of that class in the native code, but have the app register the class to which the damage callbacks should be done. Possibly the AppSupport and Bootstrap classes should be combined. Later. Also, the "android" part of the package name is superfluous; it is Android-specific code, no information gained by having an "android" part in the package name. Change-Id: Iddf55c8034ead7693887ace8438deb002c5eea9f
Diffstat (limited to 'android/Bootstrap')
-rw-r--r--android/Bootstrap/src/org/libreoffice/android/AppSupport.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/android/AppSupport.java b/android/Bootstrap/src/org/libreoffice/android/AppSupport.java
new file mode 100644
index 000000000000..ef37f183e074
--- /dev/null
+++ b/android/Bootstrap/src/org/libreoffice/android/AppSupport.java
@@ -0,0 +1,31 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+// Native functions that are used by "desktop" approach apps. That means apps
+// that have a "real" LibreOffice "main loop" running (headless).
+
+package org.libreoffice.android;
+
+import android.graphics.Bitmap;
+
+public final class AppSupport
+{
+ /* In desktop */
+ public static native void runMain();
+
+ /* In vcl */
+ public static native void renderVCL(Bitmap bitmap);
+ public static native void registerForDamageCallback(Class destinationClass);
+ public static native void setViewSize(int width, int height);
+ public static native void key(char c);
+ public static native void touch(int action, int x, int y);
+ public static native void zoom(float scale, int x, int y);
+ public static native void scroll(int x, int y);
+}
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab: