diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-12-15 18:13:11 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-21 22:54:36 +0200 |
commit | 4d258787559426e1e2a0279888eb669622889899 (patch) | |
tree | 7e9e3f31684865e750b9e28d2a40f7aa545a123e /desktop | |
parent | 52a8744afee2cd589813f0377d93f821fce7aedd (diff) |
android: finally starting and rendering at least something again.
Only renders on very-first-start after install (oddly).
We initialize vcl in it's own thread to avoid problems.
Thanks to tml for fixing a linking issue.
Change-Id: I960d11c6098681356fea0634970545aa9af9bacb
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 7 | ||||
-rw-r--r-- | desktop/source/app/sofficemain.cxx | 32 |
2 files changed, 38 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 1dc7552c4369..6260a65004cf 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -562,6 +562,8 @@ Desktop::~Desktop() void Desktop::Init() { + fprintf (stderr, "Desktop::Init()\n"); + RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" ); SetBootstrapStatus(BS_OK); @@ -593,9 +595,12 @@ void Desktop::Init() } } - if ( m_aBootstrapError == BE_OK ) + fprintf( stderr, "OfficeIPCThread %d ...\n", m_aBootstrapError == BE_OK ); + + if ( 1 ) { const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs(); + // start ipc thread only for non-remote offices RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) ::OfficeIPCThread::EnableOfficeIPCThread" ); OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread(); diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index ce226c178317..3af14743c457 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -29,6 +29,12 @@ #include <rtl/bootstrap.hxx> #include <tools/extendapplicationenvironment.hxx> + +#ifdef ANDROID +# include <jni.h> +# include <salhelper/thread.hxx> +#endif + int SVMain(); // -=-= main() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -70,6 +76,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() return EXIT_SUCCESS; } #endif + fprintf (stderr, "enter svmain()\n"); return SVMain(); #if defined ANDROID } catch (const ::com::sun::star::uno::Exception &e) { @@ -80,4 +87,29 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() #endif } +#ifdef ANDROID +class MainThread : public salhelper::Thread +{ +public: + MainThread() : salhelper::Thread("vcl-mainloop") { launch(); } + virtual void execute() + { + int nRet; + do { + nRet = soffice_main(); + fprintf( stderr, "nRet %d\n", nRet ); + } while (nRet == 81 || nRet == 79); // pretend to re-start. + exit (nRet); + } +}; + +extern "C" SAL_JNI_EXPORT void JNICALL +Java_org_libreoffice_android_examples_LODesktop_spawnMain(JNIEnv* /* env */, + jobject /* dummy */) +{ + fprintf(stderr, "Spawn main!\n"); + new MainThread(); +} +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |