diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-22 22:44:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-22 22:49:48 +0200 |
commit | 871cc191fc7b815df89ecf488cd3e18aae680b1d (patch) | |
tree | 5953d668dbd54a6fb357e4f09fff1710db7beacf /vcl/source/app | |
parent | a3035495eb67651e5bf3d785ac8f1a73eb3abf37 (diff) |
Add a wrapper for InitVCL(), to be called from Java on Android
Diffstat (limited to 'vcl/source/app')
-rw-r--r-- | vcl/source/app/svmain.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index cf98fb8a0b6a..2624e6c32b44 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -56,6 +56,11 @@ #include <ole2.h> // for _beginthreadex #endif +#ifdef ANDROID +#include <cppuhelper/bootstrap.hxx> +#include <jni.h> +#endif + // [ed 5/14/02 Add in explicit check for quartz graphics. OS X will define // unx for both quartz and X11 graphics, but we include svunx.h only if we're // building X11 graphics layers. @@ -327,6 +332,23 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang return sal_True; } +#ifdef ANDROID + +extern "C" __attribute__ ((visibility("default"))) void +InitVCLWrapper() +{ + uno::Reference<uno::XComponentContext> xContext( cppu::defaultBootstrap_InitialComponentContext() ); + uno::Reference<lang::XMultiComponentFactory> xFactory( xContext->getServiceManager() ); + + uno::Reference<lang::XMultiServiceFactory> xSM( xFactory, uno::UNO_QUERY_THROW ); + + comphelper::setProcessServiceFactory( xSM ); + + InitVCL( xSM ); +} + +#endif + namespace { |