From b02c075a16ff0b198053cf36828056c6e7ab45e7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 22 Feb 2013 15:08:23 +0200 Subject: Rename android/qa/desktop to android/experimenmtal/desktop It's not really a "QA" thing. Change-Id: I85f7b5610ecd409972b7d504bfc567707d35556e --- android/experimental/desktop/AndroidManifest.xml | 21 ++ android/experimental/desktop/Makefile | 164 +++++++++++ android/experimental/desktop/ant.properties | 17 ++ android/experimental/desktop/build.xml | 84 ++++++ android/experimental/desktop/fonts.conf | 154 ++++++++++ android/experimental/desktop/jni/Android.mk | 23 ++ android/experimental/desktop/native-code.cxx | 123 ++++++++ android/experimental/desktop/project.properties | 14 + android/experimental/desktop/res/layout/main.xml | 12 + .../experimental/desktop/res/values/strings.xml | 4 + .../libreoffice/android/examples/LODesktop.java | 312 +++++++++++++++++++++ android/qa/desktop/AndroidManifest.xml | 21 -- android/qa/desktop/Makefile | 164 ----------- android/qa/desktop/ant.properties | 17 -- android/qa/desktop/build.xml | 84 ------ android/qa/desktop/fonts.conf | 154 ---------- android/qa/desktop/jni/Android.mk | 23 -- android/qa/desktop/native-code.cxx | 123 -------- android/qa/desktop/project.properties | 14 - android/qa/desktop/res/layout/main.xml | 12 - android/qa/desktop/res/values/strings.xml | 4 - .../libreoffice/android/examples/LODesktop.java | 312 --------------------- 22 files changed, 928 insertions(+), 928 deletions(-) create mode 100644 android/experimental/desktop/AndroidManifest.xml create mode 100644 android/experimental/desktop/Makefile create mode 100644 android/experimental/desktop/ant.properties create mode 100644 android/experimental/desktop/build.xml create mode 100644 android/experimental/desktop/fonts.conf create mode 100644 android/experimental/desktop/jni/Android.mk create mode 100644 android/experimental/desktop/native-code.cxx create mode 100644 android/experimental/desktop/project.properties create mode 100644 android/experimental/desktop/res/layout/main.xml create mode 100644 android/experimental/desktop/res/values/strings.xml create mode 100644 android/experimental/desktop/src/org/libreoffice/android/examples/LODesktop.java delete mode 100644 android/qa/desktop/AndroidManifest.xml delete mode 100644 android/qa/desktop/Makefile delete mode 100644 android/qa/desktop/ant.properties delete mode 100644 android/qa/desktop/build.xml delete mode 100644 android/qa/desktop/fonts.conf delete mode 100644 android/qa/desktop/jni/Android.mk delete mode 100644 android/qa/desktop/native-code.cxx delete mode 100644 android/qa/desktop/project.properties delete mode 100644 android/qa/desktop/res/layout/main.xml delete mode 100644 android/qa/desktop/res/values/strings.xml delete mode 100644 android/qa/desktop/src/org/libreoffice/android/examples/LODesktop.java (limited to 'android') diff --git a/android/experimental/desktop/AndroidManifest.xml b/android/experimental/desktop/AndroidManifest.xml new file mode 100644 index 000000000000..c5a6cc0927ac --- /dev/null +++ b/android/experimental/desktop/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/android/experimental/desktop/Makefile b/android/experimental/desktop/Makefile new file mode 100644 index 000000000000..5ea6f3591933 --- /dev/null +++ b/android/experimental/desktop/Makefile @@ -0,0 +1,164 @@ +include ../../../config_host.mk + +# The default target just builds. +all: build-ant + +# The package of this app +APP_PACKAGE=org.libreoffice.android.examples + +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared + +# The name of the Bootstrap activity class +BOOTSTRAP=org.libreoffice.android.Bootstrap + +# The default target just builds. + +copy-stuff: +# Then "assets". Let the directory structure under assets mimic +# that under solver for now. +# +# Please note that I have no idea what all of this is really necessary and for +# much of this stuff being copied, no idea whether it makes any sense at all. +# Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of +# unit tests for sc are built, and those do seem to mostly work) and +# android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some +# extent). +# + mkdir -p assets/gz.unpack/program/ure assets/lib assets/program assets/xml/ure assets/ComponentTarget/i18npool/util + gzip -9 <$(OUTDIR)/bin/offapi.rdb >assets/gz.unpack/program/offapi.rdb + gzip -9 <$(OUTDIR)/bin/oovbaapi.rdb >assets/gz.unpack/program/oovbaapi.rdb + gzip -9 <$(OUTDIR)/bin/types.rdb >assets/gz.unpack/program/types.rdb + gzip -9 <$(OUTDIR)/bin/ure/types.rdb >assets/gz.unpack/program/ure/types.rdb +# For some reason the vnd.sun.star.expand:$LO_LIB_DIR doesn't seem to work, it expands to empty!? +# So just hardcode the known APP_DATA_PATH for now... + for F in xml/services xml/ure/services; do \ + sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$(APP_DATA_PATH)/lib/!g' <$(OUTDIR)/$$F.rdb >assets/$$F.rdb; \ + done + cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \ + $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \ + $(SRC_ROOT)/sw/qa/core/data/odt/test.odt \ + $(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \ + assets + cp $(WORKDIR)/ComponentTarget/i18npool/util/i18npool.component assets/ComponentTarget/i18npool/util +# + mkdir -p assets/ure/share/misc assets/share/registry/res assets/share/config/soffice.cfg + cp -R $(OUTDIR)/xml/*.xcd assets/share/registry + mv assets/share/registry/fcfg_langpack_en-US.xcd assets/share/registry/res + cp -R $(OUTDIR)/xml/uiconfig/* assets/share/config/soffice.cfg + cp -R $(OUTDIR)/xml/registry/* assets/share/registry +# +# Set up rc, the "inifile". See BootstrapMap::getBaseIni(). As this app +# doesn't use soffice_main() (at least I think it shouldn't), the +# rtl::Bootstrap::setIniFilename() call there that hardcodes +# /assets/program/lofficerc isn't executed. Instead the hardcoding of +# /assets/rc in BootstrapMap::getBaseIni() gets used. + echo '[Bootstrap]' > assets/rc + echo 'Logo=1' >> assets/rc + echo 'NativeProgress=1' >> assets/rc + echo 'URE_BOOTSTRAP=file:///assets/program/fundamentalrc' >> assets/rc +# echo 'RTL_LOGFILE=file:///dev/log/main' >> assets/rc + echo "HOME=$(APP_DATA_PATH)/cache" >> assets/rc + echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/cache" >> assets/rc +# +# Set up fundamentalrc + echo '[Bootstrap]' > assets/program/fundamentalrc + echo "LO_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc + echo "URE_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc # checkme - is this used to find configs ? + echo 'BRAND_BASE_DIR=file:///assets' >> assets/program/fundamentalrc + echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry' >> assets/program/fundamentalrc + echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway' >> assets/program/fundamentalrc + echo 'URE_MORE_TYPES=file://$(APP_DATA_PATH)/program/offapi.rdb file://$(APP_DATA_PATH)/program/oovbaapi.rdb' >> assets/program/fundamentalrc + echo 'URE_MORE_SERVICES=file:///assets/xml/services.rdb <$$BRAND_BASE_DIR/program/services>*' >> assets/program/fundamentalrc +# +# Set up unorc + echo '[Bootstrap]' > assets/program/unorc + echo "URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/unorc + echo 'UNO_TYPES=file://$(APP_DATA_PATH)/program/ure/types.rdb file://$(APP_DATA_PATH)/program/types.rdb $${URE_MORE_TYPES}' >> assets/program/unorc + echo 'UNO_SERVICES=file:///assets/xml/ure/services.rdb $${URE_MORE_SERVICES}' >> assets/program/unorc +# +# Set up bootstraprc + echo '[Bootstrap]' > assets/program/bootstraprc + echo 'InstallMode=' >> assets/program/bootstraprc + echo 'ProductKey=LibreOffice 3.6' >> assets/program/bootstraprc + echo "UserInstallation=file://$(APP_DATA_PATH)" >> assets/program/bootstraprc +# +# Set up versionrc + echo '[Version]' > assets/program/versionrc + echo 'AllLanguages=en-US' >> assets/program/versionrc + echo 'BuildVersion=' >> assets/program/versionrc + echo 'buildid=dead-beef' >> assets/program/versionrc + echo 'ProductMajor=360' >> assets/program/versionrc + echo 'ProductMinor=1' >> assets/program/versionrc + echo 'ReferenceOOoMajorMinor=3.6' >> assets/program/versionrc +# +# .res files + mkdir -p assets/program/resource + cp $(OUTDIR)/bin/*en-US.res assets/program/resource +# +# Assets that are unpacked at run-time into the app's data directory. These +# are files read by non-LO code, fontconfig and freetype for now, that doesn't +# understand "/assets" paths. + mkdir -p assets/unpack/etc/fonts + cp fonts.conf assets/unpack/etc/fonts +# $UserInstallation/user/fonts is added to the fontconfig path in +# vcl/generic/fontmanager/helper.cxx: psp::getFontPath(). UserInstallation is +# set to the app's data dir above. + mkdir -p assets/gz.unpack/user/fonts + for F in $(OUTDIR)/pck/Liberation*.ttf $(OUTDIR)/pck/Gen*.ttf $(OUTDIR)/pck/opens___.ttf; do \ + gzip -9 <$$F >assets/gz.unpack/user/fonts/`basename $$F`; \ + done +# +# Then gdbserver and gdb.setup so that we can debug with ndk-gdb. +# + mkdir -p $(SODEST) + cp $(ANDROID_NDK_GDBSERVER) $(SODEST) + echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup +# ------------ Pieces not from DocumentLoader ------------ +# tango artwork / icons + mkdir -p assets/share/config + cp -R $(OUTDIR)/bin/images_tango.zip assets/share/config/images.zip +# shell / splash images + mkdir -p assets/program + cp -r $(SRC_ROOT)/icon-themes/galaxy/brand/* assets/program +# presets - becomes the users home directory, .stamp forces .zip dir creation + for D in $(strip autocorr autotext backup basic config gallery \ + psprint/driver psprint/fontmetric template \ + uno_packages/cache wordbook); do \ + mkdir -p assets/presets/$$D ; \ + echo "content" > assets/presets/$$D/stamp; \ + done +# lofficerc + mkdir -p assets/program/ + echo "[Bootstrap]" > assets/program/lofficerc + echo "Logo=1" >> assets/program/lofficerc + echo "NativeProgress=1" >> assets/program/lofficerc + echo "URE_BOOTSTRAP=file:///assets/program/fundamentalrc" >> assets/program/lofficerc +# echo "RTL_LOGFILE=file:///dev/log/main" >> assets/program/lofficerc + echo "HOME=$(APP_DATA_PATH)/files" >> assets/program/lofficerc + echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/files" >> assets/program/lofficerc +# - this looks useful but breaks more than it fixes ... +# echo "DISABLE_EXTENSION_SYNCHRONIZATION=1" >> assets/program/lofficerc + + +setup-jars: +# +# Copy jar files we need +# + for F in $(strip \ + java_uno \ + juh \ + jurt \ + ridl \ + unoil \ + unoloader \ + ); do \ + $(call COPYJAR,$(OUTDIR)/bin/$${F}.jar); \ + done + +build-ant: android_version_setup copy-stuff link-so properties setup-jars + unset JAVA_HOME && $(ANT) debug + +run: + $(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n org.libreoffice.android.examples/.LODesktop -e input /asset/test1.odt +# -e lo-main-delay 20 -e lo-strace yes \ No newline at end of file diff --git a/android/experimental/desktop/ant.properties b/android/experimental/desktop/ant.properties new file mode 100644 index 000000000000..ee52d86d94a4 --- /dev/null +++ b/android/experimental/desktop/ant.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked in Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/android/experimental/desktop/build.xml b/android/experimental/desktop/build.xml new file mode 100644 index 000000000000..4aac2f548251 --- /dev/null +++ b/android/experimental/desktop/build.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/experimental/desktop/fonts.conf b/android/experimental/desktop/fonts.conf new file mode 100644 index 000000000000..699e9d101048 --- /dev/null +++ b/android/experimental/desktop/fonts.conf @@ -0,0 +1,154 @@ + + + + + + + + /system/fonts + + + serif + + Droid Serif + + + + sans-serif + + Roboto + Droid Sans Fallback + + + + monospace + + Droid Sans Mono + + + + + + + mono + + + monospace + + + + + + + sans serif + + + sans-serif + + + + + + + sans + + + sans-serif + + + + + conf.d + + + + + /data/data/org.libreoffice.android.examples/fontconfig + + + + + 0x0020 + 0x00A0 + 0x00AD + 0x034F + 0x0600 + 0x0601 + 0x0602 + 0x0603 + 0x06DD + 0x070F + 0x115F + 0x1160 + 0x1680 + 0x17B4 + 0x17B5 + 0x180E + 0x2000 + 0x2001 + 0x2002 + 0x2003 + 0x2004 + 0x2005 + 0x2006 + 0x2007 + 0x2008 + 0x2009 + 0x200A + 0x200B + 0x200C + 0x200D + 0x200E + 0x200F + 0x2028 + 0x2029 + 0x202A + 0x202B + 0x202C + 0x202D + 0x202E + 0x202F + 0x205F + 0x2060 + 0x2061 + 0x2062 + 0x2063 + 0x206A + 0x206B + 0x206C + 0x206D + 0x206E + 0x206F + 0x2800 + 0x3000 + 0x3164 + 0xFEFF + 0xFFA0 + 0xFFF9 + 0xFFFA + 0xFFFB + + + + 3600 + + + + diff --git a/android/experimental/desktop/jni/Android.mk b/android/experimental/desktop/jni/Android.mk new file mode 100644 index 000000000000..c5c2ed3b0293 --- /dev/null +++ b/android/experimental/desktop/jni/Android.mk @@ -0,0 +1,23 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := dummy +LOCAL_SRC_FILES := dummy.c +LOCAL_LDLIBS := + +include $(BUILD_SHARED_LIBRARY) diff --git a/android/experimental/desktop/native-code.cxx b/android/experimental/desktop/native-code.cxx new file mode 100644 index 000000000000..4f54ccd65c16 --- /dev/null +++ b/android/experimental/desktop/native-code.cxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; 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/. + */ + +#include "osl/detail/android-bootstrap.h" + +extern "C" +{ + extern void * animcore_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * cui_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * dba_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * evtatt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fileacc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * frm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fsstorage_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * hyphen_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lng_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lnth_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * protocolhandler_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sb_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * smd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * spl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * spell_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * svx_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * uui_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); +} + +extern "C" +__attribute__ ((visibility("default"))) +const lib_to_component_mapping * +lo_get_libmap(void) +{ + static lib_to_component_mapping map[] = { + { "libanimcorelo.a", animcore_component_getFactory }, + { "libavmedialo.a", avmedia_component_getFactory }, + { "libdbalo.a", dba_component_getFactory }, + { "libdbaxmllo.a", dbaxml_component_getFactory }, + { "libcuilo.a", cui_component_getFactory }, + { "libevtattlo.a", evtatt_component_getFactory }, + { "libfileacc.a", fileacc_component_getFactory }, + { "libfrmlo.a", frm_component_getFactory }, + { "libfsstorage.uno.a", fsstorage_component_getFactory }, + { "libfwklo.a", fwk_component_getFactory }, + { "libfwllo.a", fwl_component_getFactory }, + { "libfwmlo.a", fwm_component_getFactory }, + { "libhwplo.a", hwp_component_getFactory }, + { "libhyphenlo.a", hyphen_component_getFactory }, + { "liblnglo.a", lng_component_getFactory }, + { "liblnthlo.a", lnth_component_getFactory }, + { "liblwpftlo.a", lotuswordpro_component_getFactory }, + { "libooxlo.a", oox_component_getFactory }, + { "libprotocolhandlerlo.a", protocolhandler_component_getFactory }, + { "libscdlo.a", scd_component_getFactory }, + { "libscfiltlo.a", scfilt_component_getFactory }, + { "libsblo.a", sb_component_getFactory }, + { "libsclo.a", sc_component_getFactory }, + { "libsddlo.a", sdd_component_getFactory }, + { "libsdlo.a", sd_component_getFactory }, + { "libsmdlo.a", smd_component_getFactory }, + { "libsmlo.a", sm_component_getFactory }, + { "libspllo.a", spl_component_getFactory }, + { "libsvgfilterlo.a", svgfilter_component_getFactory }, + { "libsvxlo.a", svx_component_getFactory }, + { "libswdlo.a", swd_component_getFactory }, + { "libswlo.a", sw_component_getFactory }, + { "libt602filterlo.a", t602filter_component_getFactory }, + { "libtextfdlo.a", textfd_component_getFactory }, + { "libunordflo.a", unordf_component_getFactory }, + { "libunoxmllo.a", unoxml_component_getFactory }, + { "libuuilo.a", uui_component_getFactory }, + { "libwpftdrawlo.a", wpftdraw_component_getFactory }, + { "libwpftwriterlo.a", wpftwriter_component_getFactory }, + { "libxmlfdlo.a", xmlfd_component_getFactory }, + { "libxmlsecurity.a", xmlsecurity_component_getFactory }, + { "libxoflo.a", xof_component_getFactory }, + { "libxolo.a", xo_component_getFactory }, + { NULL, NULL } + }; + + // We need to pull this in, too, as it isn't in any of the libs we + // link with -Wl,--whole-archive. + extern void Java_org_libreoffice_android_examples_LODesktop_spawnMain(); + volatile void *p = (void *) Java_org_libreoffice_android_examples_LODesktop_spawnMain; + + extern void Java_org_libreoffice_android_examples_LODesktop_renderVCL(); + volatile void *q = (void *) Java_org_libreoffice_android_examples_LODesktop_renderVCL; + + return map; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/experimental/desktop/project.properties b/android/experimental/desktop/project.properties new file mode 100644 index 000000000000..06b2d880c3d4 --- /dev/null +++ b/android/experimental/desktop/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-14 + +# Use the Bootstrap class +android.library.reference.1=../../Bootstrap diff --git a/android/experimental/desktop/res/layout/main.xml b/android/experimental/desktop/res/layout/main.xml new file mode 100644 index 000000000000..5839d8cda704 --- /dev/null +++ b/android/experimental/desktop/res/layout/main.xml @@ -0,0 +1,12 @@ + + + + diff --git a/android/experimental/desktop/res/values/strings.xml b/android/experimental/desktop/res/values/strings.xml new file mode 100644 index 000000000000..1672493c1606 --- /dev/null +++ b/android/experimental/desktop/res/values/strings.xml @@ -0,0 +1,4 @@ + + + LibreOffice Viewer test + diff --git a/android/experimental/desktop/src/org/libreoffice/android/examples/LODesktop.java b/android/experimental/desktop/src/org/libreoffice/android/examples/LODesktop.java new file mode 100644 index 000000000000..bf370e6e36cd --- /dev/null +++ b/android/experimental/desktop/src/org/libreoffice/android/examples/LODesktop.java @@ -0,0 +1,312 @@ +// -*- 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/. + +// This is just a testbed for ideas and implementations. (Still, it might turn +// out to be somewhat useful as such while waiting for "real" apps.) + +// Important points: + +// Everything that might take a long time should be done asynchronously: +// - loading the document (loadComponentFromURL()) +// - counting number of pages (getRendererCount()) +// - rendering a page (render()) + +// Unclear whether pages can be rendered in parallel. Probably best to +// serialize all the above in the same worker thread. We use +// AsyncTask.SERIAL_EXECUTOR below. + +// While a page is loading ideally should display some animated spinner (but +// for now just a static "please wait" text). + +// === + +// How should we handle re-rendering at higher resolution when zooming in, and +// then panning around? + +// Hopefully when LO is asked to render just a part of a page (i.e. the +// MapMode of the device rendered to causes significant parts of the page to +// be outside the device) the code is clever enough to quickly skip stuff that +// will be clipped. But I don't hold my breath. + +// How could we do it? + +// 1/ Re-render just the zoomed-in area. Probably not a good idea, as probably +// the user will almost immediately also pan a bit or zoom out a bit, which +// would cause a re-render. + +// 2/ Some kind of tiled approach. Initially just one tile for the whole +// page. When zooming in, at some point (2x?) split the currently visible +// tiles into four sub-tiles, each initially displaying the same resolution as +// the parent tile. Start asynchronous rendering of visible sub-tiles at +// double resolution. Keep the "parent" rendered bitmap but don't keep bitmaps +// that go out of view. (Except perhaps for some caching.) When zooming out, +// at some point (0.5x?) merge four sub-tiles back into one. Hmm. Is this the +// right approach? + +// In any case, also this rendering at higher resolution should be done +// asynchronously, of course. If the user zooms in and pans around, the +// existing bitmap will be shown scaled (and ugly) until required rendering +// has finished and then the affected tiles are replaced with +// higher-resolution ones. + +package org.libreoffice.android.examples; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.ColorFilter; +import android.graphics.Matrix; +import android.graphics.PixelFormat; +import android.graphics.Paint; +import android.graphics.Point; +import android.graphics.Rect; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; +import android.os.AsyncTask; +import android.os.Bundle; +import android.util.Log; +import android.view.GestureDetector; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.MotionEvent; +import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.TranslateAnimation; +import android.widget.ImageView; +import android.widget.NumberPicker; +import android.widget.TextView; +import android.widget.ViewFlipper; +import android.widget.ViewSwitcher; + +import junit.framework.Assert; + +import com.sun.star.awt.Size; +import com.sun.star.awt.XBitmap; +import com.sun.star.awt.XControl; +import com.sun.star.awt.XDevice; +import com.sun.star.awt.XToolkitExperimental; +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XController; +import com.sun.star.frame.XFrame; +import com.sun.star.frame.XModel; +import com.sun.star.lang.XEventListener; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.lang.XTypeProvider; +import com.sun.star.uno.Type; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XComponentContext; +import com.sun.star.view.XRenderable; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; + +import org.libreoffice.android.Bootstrap; + +public class LODesktop + extends Activity +{ + private static final String TAG = "LODesktop"; + + /* implementend by desktop */ + private static native void spawnMain(); + + /* implementend by vcl */ + public static native void renderVCL(Bitmap bitmap); + + /** + * This class contains the state that is initialized once and never changes + * (not specific to a document or a view). + */ + class BootstrapContext + { + public long timingOverhead; + public XComponentContext componentContext; + public XMultiComponentFactory mcf; + public XComponentLoader componentLoader; + public XToolkitExperimental toolkit; + public XDevice dummySmallDevice; + } + + BootstrapContext bootstrapContext; + Bundle extras; + + class MyXController + implements XController + { + + XFrame frame; + XModel model; + + public void attachFrame(XFrame frame) + { + Log.i(TAG, "attachFrame"); + this.frame = frame; + } + + public boolean attachModel(XModel model) + { + Log.i(TAG, "attachModel"); + this.model = model; + return true; + } + + public boolean suspend(boolean doSuspend) + { + Log.i(TAG, "suspend"); + return false; + } + + public Object getViewData() + { + Log.i(TAG, "getViewData"); + return null; + } + + public void restoreViewData(Object data) + { + Log.i(TAG, "restoreViewData"); + } + + public XModel getModel() + { + Log.i(TAG, "getModel"); + return model; + } + + public XFrame getFrame() + { + Log.i(TAG, "getFrame"); + return frame; + } + + public void dispose() + { + Log.i(TAG, "dispose"); + } + + public void addEventListener(XEventListener listener) + { + Log.i(TAG, "addEventListener"); + } + + public void removeEventListener(XEventListener listener) + { + Log.i(TAG, "removeEventListener"); + } + } + + // FIXME: we should prolly manage a bitmap buffer here and give it to + // VCL to render into ... and pull the WM/stacking pieces up into the Java ... + // [ perhaps ;-] + // how can we get an event to "create a window" - need a JNI callback I guess ... + + private void initBootstrapContext() + { + try + { + bootstrapContext = new BootstrapContext(); + + long t0 = System.currentTimeMillis(); + long t1 = System.currentTimeMillis(); + bootstrapContext.timingOverhead = t1 - t0; + + Bootstrap.setup(this); + + // Avoid all the old style OSL_TRACE calls especially in vcl + Bootstrap.putenv("SAL_LOG=+WARN+INFO"); + + // Log.i(TAG, "Sleeping NOW"); + // Thread.sleep(20000); + + bootstrapContext.componentContext = com.sun.star.comp.helper.Bootstrap.defaultBootstrap_InitialComponentContext(); + + Log.i(TAG, "context is" + (bootstrapContext.componentContext!=null ? " not" : "") + " null"); + + bootstrapContext.mcf = bootstrapContext.componentContext.getServiceManager(); + + Log.i(TAG, "mcf is" + (bootstrapContext.mcf!=null ? " not" : "") + " null"); + } + catch (Exception e) + { + e.printStackTrace(System.err); + finish(); + } + } + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + Log.i(TAG, "onCreate - added here\n"); + + try { + String input; +// input = getIntent().getStringExtra("input"); +// if (input == null) +// input = "/assets/test1.odt"; + input = "-writer"; + + // We need to fake up an argv, and the argv[0] even needs to + // point to some file name that we can pretend is the "program". + // setCommandArgs() will prefix argv[0] with the app's data + // directory. + + String[] argv = { "lo-document-loader", input }; + + Bootstrap.setCommandArgs(argv); + + if (bootstrapContext == null) + initBootstrapContext(); + + spawnMain(); + } + catch (Exception e) { + e.printStackTrace(System.err); + finish(); + } + + Log.i(TAG, "onCreate - set content view\n"); + setContentView(new BitmapView(this, this)); + } +} + + class BitmapView extends android.view.View + { + LODesktop mDesktop; + Bitmap mBitmap; + + public BitmapView(Context context, LODesktop desktop) + { + super(context); + mDesktop = desktop; + mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888); + } + + @Override protected void onDraw(Canvas canvas) { +// canvas.drawColor(0xFF1ABCDD); + + mDesktop.renderVCL(mBitmap); + canvas.drawBitmap(mBitmap, 0, 0, null); + + // re-call ourselves a bit later ... + invalidate(); + } + } + +// vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/android/qa/desktop/AndroidManifest.xml b/android/qa/desktop/AndroidManifest.xml deleted file mode 100644 index c5a6cc0927ac..000000000000 --- a/android/qa/desktop/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile deleted file mode 100644 index 5ea6f3591933..000000000000 --- a/android/qa/desktop/Makefile +++ /dev/null @@ -1,164 +0,0 @@ -include ../../../config_host.mk - -# The default target just builds. -all: build-ant - -# The package of this app -APP_PACKAGE=org.libreoffice.android.examples - -BOOTSTRAPDIR=../../Bootstrap -include $(BOOTSTRAPDIR)/Makefile.shared - -# The name of the Bootstrap activity class -BOOTSTRAP=org.libreoffice.android.Bootstrap - -# The default target just builds. - -copy-stuff: -# Then "assets". Let the directory structure under assets mimic -# that under solver for now. -# -# Please note that I have no idea what all of this is really necessary and for -# much of this stuff being copied, no idea whether it makes any sense at all. -# Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of -# unit tests for sc are built, and those do seem to mostly work) and -# android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some -# extent). -# - mkdir -p assets/gz.unpack/program/ure assets/lib assets/program assets/xml/ure assets/ComponentTarget/i18npool/util - gzip -9 <$(OUTDIR)/bin/offapi.rdb >assets/gz.unpack/program/offapi.rdb - gzip -9 <$(OUTDIR)/bin/oovbaapi.rdb >assets/gz.unpack/program/oovbaapi.rdb - gzip -9 <$(OUTDIR)/bin/types.rdb >assets/gz.unpack/program/types.rdb - gzip -9 <$(OUTDIR)/bin/ure/types.rdb >assets/gz.unpack/program/ure/types.rdb -# For some reason the vnd.sun.star.expand:$LO_LIB_DIR doesn't seem to work, it expands to empty!? -# So just hardcode the known APP_DATA_PATH for now... - for F in xml/services xml/ure/services; do \ - sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$(APP_DATA_PATH)/lib/!g' <$(OUTDIR)/$$F.rdb >assets/$$F.rdb; \ - done - cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \ - $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \ - $(SRC_ROOT)/sw/qa/core/data/odt/test.odt \ - $(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \ - assets - cp $(WORKDIR)/ComponentTarget/i18npool/util/i18npool.component assets/ComponentTarget/i18npool/util -# - mkdir -p assets/ure/share/misc assets/share/registry/res assets/share/config/soffice.cfg - cp -R $(OUTDIR)/xml/*.xcd assets/share/registry - mv assets/share/registry/fcfg_langpack_en-US.xcd assets/share/registry/res - cp -R $(OUTDIR)/xml/uiconfig/* assets/share/config/soffice.cfg - cp -R $(OUTDIR)/xml/registry/* assets/share/registry -# -# Set up rc, the "inifile". See BootstrapMap::getBaseIni(). As this app -# doesn't use soffice_main() (at least I think it shouldn't), the -# rtl::Bootstrap::setIniFilename() call there that hardcodes -# /assets/program/lofficerc isn't executed. Instead the hardcoding of -# /assets/rc in BootstrapMap::getBaseIni() gets used. - echo '[Bootstrap]' > assets/rc - echo 'Logo=1' >> assets/rc - echo 'NativeProgress=1' >> assets/rc - echo 'URE_BOOTSTRAP=file:///assets/program/fundamentalrc' >> assets/rc -# echo 'RTL_LOGFILE=file:///dev/log/main' >> assets/rc - echo "HOME=$(APP_DATA_PATH)/cache" >> assets/rc - echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/cache" >> assets/rc -# -# Set up fundamentalrc - echo '[Bootstrap]' > assets/program/fundamentalrc - echo "LO_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc - echo "URE_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc # checkme - is this used to find configs ? - echo 'BRAND_BASE_DIR=file:///assets' >> assets/program/fundamentalrc - echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry' >> assets/program/fundamentalrc - echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway' >> assets/program/fundamentalrc - echo 'URE_MORE_TYPES=file://$(APP_DATA_PATH)/program/offapi.rdb file://$(APP_DATA_PATH)/program/oovbaapi.rdb' >> assets/program/fundamentalrc - echo 'URE_MORE_SERVICES=file:///assets/xml/services.rdb <$$BRAND_BASE_DIR/program/services>*' >> assets/program/fundamentalrc -# -# Set up unorc - echo '[Bootstrap]' > assets/program/unorc - echo "URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/unorc - echo 'UNO_TYPES=file://$(APP_DATA_PATH)/program/ure/types.rdb file://$(APP_DATA_PATH)/program/types.rdb $${URE_MORE_TYPES}' >> assets/program/unorc - echo 'UNO_SERVICES=file:///assets/xml/ure/services.rdb $${URE_MORE_SERVICES}' >> assets/program/unorc -# -# Set up bootstraprc - echo '[Bootstrap]' > assets/program/bootstraprc - echo 'InstallMode=' >> assets/program/bootstraprc - echo 'ProductKey=LibreOffice 3.6' >> assets/program/bootstraprc - echo "UserInstallation=file://$(APP_DATA_PATH)" >> assets/program/bootstraprc -# -# Set up versionrc - echo '[Version]' > assets/program/versionrc - echo 'AllLanguages=en-US' >> assets/program/versionrc - echo 'BuildVersion=' >> assets/program/versionrc - echo 'buildid=dead-beef' >> assets/program/versionrc - echo 'ProductMajor=360' >> assets/program/versionrc - echo 'ProductMinor=1' >> assets/program/versionrc - echo 'ReferenceOOoMajorMinor=3.6' >> assets/program/versionrc -# -# .res files - mkdir -p assets/program/resource - cp $(OUTDIR)/bin/*en-US.res assets/program/resource -# -# Assets that are unpacked at run-time into the app's data directory. These -# are files read by non-LO code, fontconfig and freetype for now, that doesn't -# understand "/assets" paths. - mkdir -p assets/unpack/etc/fonts - cp fonts.conf assets/unpack/etc/fonts -# $UserInstallation/user/fonts is added to the fontconfig path in -# vcl/generic/fontmanager/helper.cxx: psp::getFontPath(). UserInstallation is -# set to the app's data dir above. - mkdir -p assets/gz.unpack/user/fonts - for F in $(OUTDIR)/pck/Liberation*.ttf $(OUTDIR)/pck/Gen*.ttf $(OUTDIR)/pck/opens___.ttf; do \ - gzip -9 <$$F >assets/gz.unpack/user/fonts/`basename $$F`; \ - done -# -# Then gdbserver and gdb.setup so that we can debug with ndk-gdb. -# - mkdir -p $(SODEST) - cp $(ANDROID_NDK_GDBSERVER) $(SODEST) - echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup -# ------------ Pieces not from DocumentLoader ------------ -# tango artwork / icons - mkdir -p assets/share/config - cp -R $(OUTDIR)/bin/images_tango.zip assets/share/config/images.zip -# shell / splash images - mkdir -p assets/program - cp -r $(SRC_ROOT)/icon-themes/galaxy/brand/* assets/program -# presets - becomes the users home directory, .stamp forces .zip dir creation - for D in $(strip autocorr autotext backup basic config gallery \ - psprint/driver psprint/fontmetric template \ - uno_packages/cache wordbook); do \ - mkdir -p assets/presets/$$D ; \ - echo "content" > assets/presets/$$D/stamp; \ - done -# lofficerc - mkdir -p assets/program/ - echo "[Bootstrap]" > assets/program/lofficerc - echo "Logo=1" >> assets/program/lofficerc - echo "NativeProgress=1" >> assets/program/lofficerc - echo "URE_BOOTSTRAP=file:///assets/program/fundamentalrc" >> assets/program/lofficerc -# echo "RTL_LOGFILE=file:///dev/log/main" >> assets/program/lofficerc - echo "HOME=$(APP_DATA_PATH)/files" >> assets/program/lofficerc - echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/files" >> assets/program/lofficerc -# - this looks useful but breaks more than it fixes ... -# echo "DISABLE_EXTENSION_SYNCHRONIZATION=1" >> assets/program/lofficerc - - -setup-jars: -# -# Copy jar files we need -# - for F in $(strip \ - java_uno \ - juh \ - jurt \ - ridl \ - unoil \ - unoloader \ - ); do \ - $(call COPYJAR,$(OUTDIR)/bin/$${F}.jar); \ - done - -build-ant: android_version_setup copy-stuff link-so properties setup-jars - unset JAVA_HOME && $(ANT) debug - -run: - $(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n org.libreoffice.android.examples/.LODesktop -e input /asset/test1.odt -# -e lo-main-delay 20 -e lo-strace yes \ No newline at end of file diff --git a/android/qa/desktop/ant.properties b/android/qa/desktop/ant.properties deleted file mode 100644 index ee52d86d94a4..000000000000 --- a/android/qa/desktop/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked in Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/android/qa/desktop/build.xml b/android/qa/desktop/build.xml deleted file mode 100644 index 4aac2f548251..000000000000 --- a/android/qa/desktop/build.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/qa/desktop/fonts.conf b/android/qa/desktop/fonts.conf deleted file mode 100644 index 699e9d101048..000000000000 --- a/android/qa/desktop/fonts.conf +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - /system/fonts - - - serif - - Droid Serif - - - - sans-serif - - Roboto - Droid Sans Fallback - - - - monospace - - Droid Sans Mono - - - - - - - mono - - - monospace - - - - - - - sans serif - - - sans-serif - - - - - - - sans - - - sans-serif - - - - - conf.d - - - - - /data/data/org.libreoffice.android.examples/fontconfig - - - - - 0x0020 - 0x00A0 - 0x00AD - 0x034F - 0x0600 - 0x0601 - 0x0602 - 0x0603 - 0x06DD - 0x070F - 0x115F - 0x1160 - 0x1680 - 0x17B4 - 0x17B5 - 0x180E - 0x2000 - 0x2001 - 0x2002 - 0x2003 - 0x2004 - 0x2005 - 0x2006 - 0x2007 - 0x2008 - 0x2009 - 0x200A - 0x200B - 0x200C - 0x200D - 0x200E - 0x200F - 0x2028 - 0x2029 - 0x202A - 0x202B - 0x202C - 0x202D - 0x202E - 0x202F - 0x205F - 0x2060 - 0x2061 - 0x2062 - 0x2063 - 0x206A - 0x206B - 0x206C - 0x206D - 0x206E - 0x206F - 0x2800 - 0x3000 - 0x3164 - 0xFEFF - 0xFFA0 - 0xFFF9 - 0xFFFA - 0xFFFB - - - - 3600 - - - - diff --git a/android/qa/desktop/jni/Android.mk b/android/qa/desktop/jni/Android.mk deleted file mode 100644 index c5c2ed3b0293..000000000000 --- a/android/qa/desktop/jni/Android.mk +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2009 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := dummy -LOCAL_SRC_FILES := dummy.c -LOCAL_LDLIBS := - -include $(BUILD_SHARED_LIBRARY) diff --git a/android/qa/desktop/native-code.cxx b/android/qa/desktop/native-code.cxx deleted file mode 100644 index 4f54ccd65c16..000000000000 --- a/android/qa/desktop/native-code.cxx +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- Mode: C++; 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/. - */ - -#include "osl/detail/android-bootstrap.h" - -extern "C" -{ - extern void * animcore_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * cui_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * dba_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * evtatt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * fileacc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * frm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * fsstorage_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * hyphen_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * lng_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * lnth_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * protocolhandler_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sb_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * smd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * spl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * spell_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * svx_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * uui_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); -} - -extern "C" -__attribute__ ((visibility("default"))) -const lib_to_component_mapping * -lo_get_libmap(void) -{ - static lib_to_component_mapping map[] = { - { "libanimcorelo.a", animcore_component_getFactory }, - { "libavmedialo.a", avmedia_component_getFactory }, - { "libdbalo.a", dba_component_getFactory }, - { "libdbaxmllo.a", dbaxml_component_getFactory }, - { "libcuilo.a", cui_component_getFactory }, - { "libevtattlo.a", evtatt_component_getFactory }, - { "libfileacc.a", fileacc_component_getFactory }, - { "libfrmlo.a", frm_component_getFactory }, - { "libfsstorage.uno.a", fsstorage_component_getFactory }, - { "libfwklo.a", fwk_component_getFactory }, - { "libfwllo.a", fwl_component_getFactory }, - { "libfwmlo.a", fwm_component_getFactory }, - { "libhwplo.a", hwp_component_getFactory }, - { "libhyphenlo.a", hyphen_component_getFactory }, - { "liblnglo.a", lng_component_getFactory }, - { "liblnthlo.a", lnth_component_getFactory }, - { "liblwpftlo.a", lotuswordpro_component_getFactory }, - { "libooxlo.a", oox_component_getFactory }, - { "libprotocolhandlerlo.a", protocolhandler_component_getFactory }, - { "libscdlo.a", scd_component_getFactory }, - { "libscfiltlo.a", scfilt_component_getFactory }, - { "libsblo.a", sb_component_getFactory }, - { "libsclo.a", sc_component_getFactory }, - { "libsddlo.a", sdd_component_getFactory }, - { "libsdlo.a", sd_component_getFactory }, - { "libsmdlo.a", smd_component_getFactory }, - { "libsmlo.a", sm_component_getFactory }, - { "libspllo.a", spl_component_getFactory }, - { "libsvgfilterlo.a", svgfilter_component_getFactory }, - { "libsvxlo.a", svx_component_getFactory }, - { "libswdlo.a", swd_component_getFactory }, - { "libswlo.a", sw_component_getFactory }, - { "libt602filterlo.a", t602filter_component_getFactory }, - { "libtextfdlo.a", textfd_component_getFactory }, - { "libunordflo.a", unordf_component_getFactory }, - { "libunoxmllo.a", unoxml_component_getFactory }, - { "libuuilo.a", uui_component_getFactory }, - { "libwpftdrawlo.a", wpftdraw_component_getFactory }, - { "libwpftwriterlo.a", wpftwriter_component_getFactory }, - { "libxmlfdlo.a", xmlfd_component_getFactory }, - { "libxmlsecurity.a", xmlsecurity_component_getFactory }, - { "libxoflo.a", xof_component_getFactory }, - { "libxolo.a", xo_component_getFactory }, - { NULL, NULL } - }; - - // We need to pull this in, too, as it isn't in any of the libs we - // link with -Wl,--whole-archive. - extern void Java_org_libreoffice_android_examples_LODesktop_spawnMain(); - volatile void *p = (void *) Java_org_libreoffice_android_examples_LODesktop_spawnMain; - - extern void Java_org_libreoffice_android_examples_LODesktop_renderVCL(); - volatile void *q = (void *) Java_org_libreoffice_android_examples_LODesktop_renderVCL; - - return map; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/qa/desktop/project.properties b/android/qa/desktop/project.properties deleted file mode 100644 index 06b2d880c3d4..000000000000 --- a/android/qa/desktop/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-14 - -# Use the Bootstrap class -android.library.reference.1=../../Bootstrap diff --git a/android/qa/desktop/res/layout/main.xml b/android/qa/desktop/res/layout/main.xml deleted file mode 100644 index 5839d8cda704..000000000000 --- a/android/qa/desktop/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/android/qa/desktop/res/values/strings.xml b/android/qa/desktop/res/values/strings.xml deleted file mode 100644 index 1672493c1606..000000000000 --- a/android/qa/desktop/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - LibreOffice Viewer test - diff --git a/android/qa/desktop/src/org/libreoffice/android/examples/LODesktop.java b/android/qa/desktop/src/org/libreoffice/android/examples/LODesktop.java deleted file mode 100644 index bf370e6e36cd..000000000000 --- a/android/qa/desktop/src/org/libreoffice/android/examples/LODesktop.java +++ /dev/null @@ -1,312 +0,0 @@ -// -*- 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/. - -// This is just a testbed for ideas and implementations. (Still, it might turn -// out to be somewhat useful as such while waiting for "real" apps.) - -// Important points: - -// Everything that might take a long time should be done asynchronously: -// - loading the document (loadComponentFromURL()) -// - counting number of pages (getRendererCount()) -// - rendering a page (render()) - -// Unclear whether pages can be rendered in parallel. Probably best to -// serialize all the above in the same worker thread. We use -// AsyncTask.SERIAL_EXECUTOR below. - -// While a page is loading ideally should display some animated spinner (but -// for now just a static "please wait" text). - -// === - -// How should we handle re-rendering at higher resolution when zooming in, and -// then panning around? - -// Hopefully when LO is asked to render just a part of a page (i.e. the -// MapMode of the device rendered to causes significant parts of the page to -// be outside the device) the code is clever enough to quickly skip stuff that -// will be clipped. But I don't hold my breath. - -// How could we do it? - -// 1/ Re-render just the zoomed-in area. Probably not a good idea, as probably -// the user will almost immediately also pan a bit or zoom out a bit, which -// would cause a re-render. - -// 2/ Some kind of tiled approach. Initially just one tile for the whole -// page. When zooming in, at some point (2x?) split the currently visible -// tiles into four sub-tiles, each initially displaying the same resolution as -// the parent tile. Start asynchronous rendering of visible sub-tiles at -// double resolution. Keep the "parent" rendered bitmap but don't keep bitmaps -// that go out of view. (Except perhaps for some caching.) When zooming out, -// at some point (0.5x?) merge four sub-tiles back into one. Hmm. Is this the -// right approach? - -// In any case, also this rendering at higher resolution should be done -// asynchronously, of course. If the user zooms in and pans around, the -// existing bitmap will be shown scaled (and ugly) until required rendering -// has finished and then the affected tiles are replaced with -// higher-resolution ones. - -package org.libreoffice.android.examples; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.PixelFormat; -import android.graphics.Paint; -import android.graphics.Point; -import android.graphics.Rect; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; -import android.os.AsyncTask; -import android.os.Bundle; -import android.util.Log; -import android.view.GestureDetector; -import android.view.Gravity; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.ViewGroup; -import android.view.animation.Animation; -import android.view.animation.AnimationSet; -import android.view.animation.TranslateAnimation; -import android.widget.ImageView; -import android.widget.NumberPicker; -import android.widget.TextView; -import android.widget.ViewFlipper; -import android.widget.ViewSwitcher; - -import junit.framework.Assert; - -import com.sun.star.awt.Size; -import com.sun.star.awt.XBitmap; -import com.sun.star.awt.XControl; -import com.sun.star.awt.XDevice; -import com.sun.star.awt.XToolkitExperimental; -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XController; -import com.sun.star.frame.XFrame; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XEventListener; -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.view.XRenderable; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; - -import org.libreoffice.android.Bootstrap; - -public class LODesktop - extends Activity -{ - private static final String TAG = "LODesktop"; - - /* implementend by desktop */ - private static native void spawnMain(); - - /* implementend by vcl */ - public static native void renderVCL(Bitmap bitmap); - - /** - * This class contains the state that is initialized once and never changes - * (not specific to a document or a view). - */ - class BootstrapContext - { - public long timingOverhead; - public XComponentContext componentContext; - public XMultiComponentFactory mcf; - public XComponentLoader componentLoader; - public XToolkitExperimental toolkit; - public XDevice dummySmallDevice; - } - - BootstrapContext bootstrapContext; - Bundle extras; - - class MyXController - implements XController - { - - XFrame frame; - XModel model; - - public void attachFrame(XFrame frame) - { - Log.i(TAG, "attachFrame"); - this.frame = frame; - } - - public boolean attachModel(XModel model) - { - Log.i(TAG, "attachModel"); - this.model = model; - return true; - } - - public boolean suspend(boolean doSuspend) - { - Log.i(TAG, "suspend"); - return false; - } - - public Object getViewData() - { - Log.i(TAG, "getViewData"); - return null; - } - - public void restoreViewData(Object data) - { - Log.i(TAG, "restoreViewData"); - } - - public XModel getModel() - { - Log.i(TAG, "getModel"); - return model; - } - - public XFrame getFrame() - { - Log.i(TAG, "getFrame"); - return frame; - } - - public void dispose() - { - Log.i(TAG, "dispose"); - } - - public void addEventListener(XEventListener listener) - { - Log.i(TAG, "addEventListener"); - } - - public void removeEventListener(XEventListener listener) - { - Log.i(TAG, "removeEventListener"); - } - } - - // FIXME: we should prolly manage a bitmap buffer here and give it to - // VCL to render into ... and pull the WM/stacking pieces up into the Java ... - // [ perhaps ;-] - // how can we get an event to "create a window" - need a JNI callback I guess ... - - private void initBootstrapContext() - { - try - { - bootstrapContext = new BootstrapContext(); - - long t0 = System.currentTimeMillis(); - long t1 = System.currentTimeMillis(); - bootstrapContext.timingOverhead = t1 - t0; - - Bootstrap.setup(this); - - // Avoid all the old style OSL_TRACE calls especially in vcl - Bootstrap.putenv("SAL_LOG=+WARN+INFO"); - - // Log.i(TAG, "Sleeping NOW"); - // Thread.sleep(20000); - - bootstrapContext.componentContext = com.sun.star.comp.helper.Bootstrap.defaultBootstrap_InitialComponentContext(); - - Log.i(TAG, "context is" + (bootstrapContext.componentContext!=null ? " not" : "") + " null"); - - bootstrapContext.mcf = bootstrapContext.componentContext.getServiceManager(); - - Log.i(TAG, "mcf is" + (bootstrapContext.mcf!=null ? " not" : "") + " null"); - } - catch (Exception e) - { - e.printStackTrace(System.err); - finish(); - } - } - - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - Log.i(TAG, "onCreate - added here\n"); - - try { - String input; -// input = getIntent().getStringExtra("input"); -// if (input == null) -// input = "/assets/test1.odt"; - input = "-writer"; - - // We need to fake up an argv, and the argv[0] even needs to - // point to some file name that we can pretend is the "program". - // setCommandArgs() will prefix argv[0] with the app's data - // directory. - - String[] argv = { "lo-document-loader", input }; - - Bootstrap.setCommandArgs(argv); - - if (bootstrapContext == null) - initBootstrapContext(); - - spawnMain(); - } - catch (Exception e) { - e.printStackTrace(System.err); - finish(); - } - - Log.i(TAG, "onCreate - set content view\n"); - setContentView(new BitmapView(this, this)); - } -} - - class BitmapView extends android.view.View - { - LODesktop mDesktop; - Bitmap mBitmap; - - public BitmapView(Context context, LODesktop desktop) - { - super(context); - mDesktop = desktop; - mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888); - } - - @Override protected void onDraw(Canvas canvas) { -// canvas.drawColor(0xFF1ABCDD); - - mDesktop.renderVCL(mBitmap); - canvas.drawBitmap(mBitmap, 0, 0, null); - - // re-call ourselves a bit later ... - invalidate(); - } - } - -// vim:set shiftwidth=4 softtabstop=4 expandtab: -- cgit