summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-05-29 23:57:58 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-05-30 00:02:18 +0300
commitc9f5b8a33434266c025d546eeb4c11f49fad8570 (patch)
treea1af60159c87cf4e97231e75f67c3c836ce5c104
parenta9a0ed1edc6452560a6e8985f5a33f09859af977 (diff)
Add temporary test JNI method createWindowFoo()...
Change-Id: I8f99399faa3b0762bdea2aac09f1b849639cd191
-rw-r--r--android/Bootstrap/src/org/libreoffice/android/Bootstrap.java5
-rw-r--r--sal/android/lo-bootstrap.c19
-rw-r--r--vcl/source/window/wrkwin.cxx10
3 files changed, 33 insertions, 1 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
index a799f44175c1..25fded86dfc4 100644
--- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
+++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
@@ -97,10 +97,13 @@ public class Bootstrap extends NativeActivity
// where the lo-bootstrap library is.
public static native void setCommandArgs(String[] argv);
- // A wrapper for InitUCBHelper() in he ucbhelper library
+ // A wrapper for InitUCBHelper() in the ucbhelper library
// (contentbroker.cxx), also this called indirectly through the lo-bootstrap library
public static native void initUCBHelper();
+ // A wrapper for createWindowFoo() in the vcl library
+ public static native int createWindowFoo();
+
// A method that starts a thread to redirect stdout and stderr writes to
// the Android logging mechanism, or stops the redirection.
public static native boolean redirect_stdio(boolean state);
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index a180e62eb434..9adadef636ce 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -1633,6 +1633,25 @@ Java_org_libreoffice_android_Bootstrap_initUCBHelper(JNIEnv* env,
(*InitUCBHelper)();
}
+__attribute__ ((visibility("default")))
+jint
+Java_org_libreoffice_android_Bootstrap_createWindowFoo(JNIEnv* env,
+ jobject clazz)
+{
+ int (*createWindowFoo)(void);
+ (void) env;
+ (void) clazz;
+
+ lo_dlopen("libvcllo.so");
+ createWindowFoo = dlsym(RTLD_DEFAULT, "createWindowFoo");
+ if (createWindowFoo == NULL) {
+ LOGE("createWindowFoo: createWindowFoo not found");
+ return 0;
+ }
+ return (*createWindowFoo)();
+}
+
+
/* Code for reading lines from the pipe based on the (Apache-licensed) Android
* logwrapper.c
*/
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 64381456db48..a4f79d29ee32 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -107,6 +107,16 @@ WorkWindow::WorkWindow( WindowType nType ) :
ImplInitWorkWindowData();
}
+#ifdef ANDROID
+
+extern "C" void *
+createWindowFoo(void)
+{
+ return (void*) new WorkWindow((Window *)NULL);
+}
+
+#endif
+
// -----------------------------------------------------------------------
WorkWindow::WorkWindow( Window* pParent, WinBits nStyle ) :