Hack soffice_main into LOK.

Change-Id: I86e13192ddb5904afabca38d3a201f17f145de09
Add OfficeIPCThread::WaitForReady.

For LibreOfficeKit we need to start up the event loop, and can't continue
initialisation until all the related (VCL etc.) setup is complete -- the
OfficeIPCThread is also enabled as one of the last items, and can be
used to indicate whether or not we can start actually working with VCL.

Change-Id: I0450b65584ddf6e8d02ce0c6e66e06f47841d1b7
Bin outdated / incorrect comment.

Change-Id: I7b8f97377b9606a2228f172f772d8051a64703d2
Use OfficeIPCThread::WaitForReady rather than sleeping.

This way we actually continue when we're ready to, rather than
dumbly hoping we wait for long enough.

This isn't entirely unproblematic though -- if we have no config
pre-prepared (i.e. first-run), then we just end up hanging on this
since soffice_main exits without doing anything to the OfficeIPCThread.
(Which is especially problematic for unit tests which specifically run
 on an empty config.)

Change-Id: I064fb500a224cfe37a0d3ba24b6154ffd72a71a3
Add OfficeIPCThread::IsEnabled.

This lets us easily check whether Desktop::Main has shut down,
i.e. which happens on the first restart-requiring initialisation.

Change-Id: I7fe5699a4bf59e2c3b891ac73abd9b147773d22e
Fail LOK initialisation if restart is required.

Change-Id: Ia13a3523666147f002b5a5177fd6962d55556f56
Implement lokconf_init.

This is a simple executable which can be used to ensure there is a
pe-pared configuration for unit-tests to avoid the usually required
re-start on the first run.

Change-Id: I49b706e8daa93bc34db508a24615b63b9babddba
Add gb_CppunitTest_use_confpreinit:

For unit tests that use the VCL event loop we can use this to
avoid the otherwise required restart.

Change-Id: I48265d7e7188a4efaa6f87432c762320331c0c78
Use gb_CppunitTest_use_confpreinit for LOK tiled rendering.

Now that we use the event loop for LOK we need to make sure that
it is able to run successfully first time, as unit tests start
with a completely clean config.

Change-Id: If9ddcb75fe8286381d71ecdc76ac7eb3697960d0
Don't start Impress Remote server in headless mode.

Change-Id: Ibafe57413a60745e949dc3146fbc843c52c029d6
Don't fail on --protector.

If we have any "unknown" command line arguments Desktop init will fail,
however our LOK Tiled Rendering test uses Desktop (via soffice_main).
(Other unit tests don't use soffice_main hence this check never
comes into play.) It looks like it's most reliable simply to ignore
--protector here, rather than try to filter it out elsewhere (which
is difficult as it is passed to osl via SAL_IMPLEMENT_MAIN).

Change-Id: I95d047892851ba2cf9edd2e26bacc6efa0320f71
Make sure LOK is actually headless.

This prevents e.g. the document recovery dialog from trying to be shown.

Change-Id: I253720f7fa1abd1c053670434f8394473517b670
LOK: do clean main thread shutdown cleanly.

Change-Id: If44971f67a489f6b50dee6c1683707c47e695de4
Kill the libreofficekit static library / shim.c.

It looks like the cleanest method of getting lok_init into
a LibreOfficeKitInit.h header (in a c89 compatible way) is to
have it as a static function.

(inline is only available in C99 or later -- this is actually
 available on Linux which is the only place that we can actually
 use lok_init anyways currently, however given we have to keep
 c89 for the C code (for MSVC) compatibility, selectively enabling
 c99 would likely be more messy.)

Conflicts:
	libreofficekit/Module_libreofficekit.mk

Change-Id: I0493e7a68ed5397479220bb6ba8c3db870b6dd32
Upgrade lokconf_init to LibreOfficeKitInit.h

Change-Id: I0581a107c3eefd33c25b003afe9f7be217598441
Make common paths member variables.

We'll need these for other tests too.

Change-Id: Ia99c2e60f5e5bb24a83875a9dcf85a6b4f54beb4
LOK Android: don't initialise until TMPDIR is set.

As part of LOK initialisation we now start soffice_main, this
requires TMPDIR access, and will fail if we haven't set TMPDIR
(as by default it attemps to access /tmp which is not allowed on
Android).

Change-Id: I63bd7bce9b52c898c60fda6eea33ee919349a109
Don't use ImplDoTiledRendering for Android.

With svp this causes images not to be rendered for tiled rendering,
however this could potentially cause issues with SmartArt (however
SmartArt support for Tiled Rendering is possibly problematic in any case).

Change-Id: Iccbdce7b6d5353966892fbde3d3d10eb49164df9
TEMPORARY: We need OfficeIPCThread for LOK on Android for now.

LOK uses the OfficeIPCThread to know that soffice_main is ready --
we should have some form of separate condition instead since I don't
think we need any of the actual functionality here for Android.

Change-Id: I27030383aae4d7895725c2161c53617f896a5f83
Enable OfficeIPCThread for LOK on Android in a safer way

Change-Id: Ie4227bba37500ca755207b64a928a19f46419ff0