2020-07-02 08:57:22 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
2023-11-09 12:23:00 -06:00
|
|
|
* Copyright the Collabora Online contributors.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*
|
2020-07-02 08:57:22 -05:00
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <Log.hpp>
|
|
|
|
|
|
|
|
inline void setupKitEnvironment(const std::string& userInterface)
|
|
|
|
{
|
|
|
|
// Setup & check environment
|
2021-02-08 14:52:17 -06:00
|
|
|
std::string layers(
|
2020-07-02 08:57:22 -05:00
|
|
|
"xcsxcu:${BRAND_BASE_DIR}/share/registry "
|
|
|
|
"res:${BRAND_BASE_DIR}/share/registry "
|
|
|
|
"bundledext:${${BRAND_BASE_DIR}/program/lounorc:BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini "
|
|
|
|
"sharedext:${${BRAND_BASE_DIR}/program/lounorc:SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini "
|
|
|
|
"userext:${${BRAND_BASE_DIR}/program/lounorc:UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini "
|
2021-02-08 14:52:17 -06:00
|
|
|
);
|
2020-07-02 08:57:22 -05:00
|
|
|
#ifdef IOS
|
2021-11-18 06:08:14 -06:00
|
|
|
layers += "user:*${BRAND_BASE_DIR}/coolkitconfig.xcu ";
|
2020-07-02 08:57:22 -05:00
|
|
|
#elif ENABLE_DEBUG && !defined(ANDROID) // '*' denotes non-writable.
|
2021-11-18 06:08:14 -06:00
|
|
|
layers += "user:*file://" DEBUG_ABSSRCDIR "/coolkitconfig.xcu ";
|
2020-07-02 08:57:22 -05:00
|
|
|
#else
|
2021-11-18 06:08:14 -06:00
|
|
|
if(::getenv("COOLKITCONFIG_XCU"))
|
|
|
|
layers += "user:*file://" + std::string(::getenv("COOLKITCONFIG_XCU")) + " ";
|
2021-02-08 14:52:17 -06:00
|
|
|
else
|
2021-11-18 06:08:14 -06:00
|
|
|
layers += "user:*file://" COOLWSD_CONFIGDIR "/coolkitconfig.xcu ";
|
2020-07-02 08:57:22 -05:00
|
|
|
#endif
|
|
|
|
::setenv("CONFIGURATION_LAYERS", layers.c_str(),
|
|
|
|
1 /* override */);
|
|
|
|
|
2024-03-17 17:11:02 -05:00
|
|
|
if (!Util::isMobileApp())
|
|
|
|
{
|
|
|
|
// No-caps tracing can spawn eg. glxinfo & other oddness.
|
|
|
|
unsetenv("DISPLAY");
|
|
|
|
}
|
2020-07-02 08:57:22 -05:00
|
|
|
|
|
|
|
// Set various options we need.
|
|
|
|
std::string options = "unipoll";
|
|
|
|
if (userInterface == "notebookbar")
|
|
|
|
options += ":notebookbar";
|
|
|
|
|
2021-04-06 05:05:47 -05:00
|
|
|
options += ":sc_no_grid_bg";
|
2020-07-05 12:57:59 -05:00
|
|
|
|
|
|
|
options += ":sc_print_twips_msgs";
|
|
|
|
|
2020-07-02 08:57:22 -05:00
|
|
|
::setenv("SAL_LOK_OPTIONS", options.c_str(), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|