diff --git a/build/gn/fangtian.gni b/build/gn/fangtian.gni index 633f18a6451bd791a7ec303e82315d056262c4f0..eed273c0adf629141882ad96717bef6a3013ccde 100755 --- a/build/gn/fangtian.gni +++ b/build/gn/fangtian.gni @@ -15,6 +15,4 @@ import("//build/gn/templates/build_targets.gni") declare_args() { is_fangtian_build = true - window_manager_path = "//window_manager" - display_server_path = "//display_server" } diff --git a/build/prebuild.sh b/build/prebuild.sh index 4b76d96011203023dac15016e86dbe140277c72a..787306631ad912e7d4d9b7230a4d9e5d9a4ff101 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -114,4 +114,9 @@ cd ${PROJECT_DIR}/prebuilts/rpm/binary ./install.sh cd ${PROJECT_DIR} +# copy config files to /usr/local/share/ft/window_manager +sudo mkdir -p /usr/local/share/ft/window_manager +sudo cp ${PROJECT_DIR}/window_manager/resources/config/other/display_manager_config.xml /usr/local/share/ft/window_manager +sudo cp ${PROJECT_DIR}/window_manager/resources/config/other/window_manager_config.xml /usr/local/share/ft/window_manager + echo -e "\033[32m[*] Pre-build Done. You need exec 'build.sh'.\033[0m" diff --git a/config.gni b/config.gni new file mode 100644 index 0000000000000000000000000000000000000000..be3b48e4636c23297739492b664a07c14cf49a19 --- /dev/null +++ b/config.gni @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. All rights reserved. +# 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 + +declare_args() { + display_server_path = "//display_server" + window_manager_path = "//window_manager" + ft_engine_defines = [ "_FANGTIAN" ] +} diff --git a/window_manager/dm/ft_build/BUILD.gn b/window_manager/dm/ft_build/BUILD.gn index bc1ee331f5b3c142199e439d5f2a67d2840ba62a..649aca2da4e0857fd230880ee8653b83c6c606d5 100644 --- a/window_manager/dm/ft_build/BUILD.gn +++ b/window_manager/dm/ft_build/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License import("//build/gn/fangtian.gni") +import("//config.gni") config("libdm_private_config") { cflags = [ "-Wno-c++11-narrowing" ] diff --git a/window_manager/dmserver/ft_build/BUILD.gn b/window_manager/dmserver/ft_build/BUILD.gn index 1e630e85c92031342f61913c570548fef04e67a3..d54291e1b203bf269e8cef01d9f5cad7d1f13016 100644 --- a/window_manager/dmserver/ft_build/BUILD.gn +++ b/window_manager/dmserver/ft_build/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") +import("//config.gni") config("libdms_private_config") { cflags = [ "-Wno-c++11-narrowing" ] @@ -22,7 +23,7 @@ config("libdms_private_config") { "$window_manager_path/ft_adapter", "$display_server_path/utils/buffer_handle/export", "$display_server_path/rosen/modules/composer/vsync/include", - "/usr/include/libxml2" + "/usr/include/libxml2", ] } @@ -31,6 +32,8 @@ config("libdms_public_config") { } ft_shared_library("libdms") { + defines = ft_engine_defines + sources = [ "$window_manager_path/dm/src/zidl/display_manager_agent_proxy.cpp", "$window_manager_path/dmserver/src/abstract_display.cpp", diff --git a/window_manager/dmserver/src/display_manager_config.cpp b/window_manager/dmserver/src/display_manager_config.cpp index 0718d404481c183cfe30083e10a79d2dd4d71154..47b310244535999e8c82589c44e469425b408a42 100644 --- a/window_manager/dmserver/src/display_manager_config.cpp +++ b/window_manager/dmserver/src/display_manager_config.cpp @@ -66,14 +66,18 @@ bool inline DisplayManagerConfig::IsNumber(std::string str) std::string DisplayManagerConfig::GetConfigPath(const std::string& configFileName) { +#ifdef _FANGTIAN + return "/usr/local/share/ft/window_manager/display_manager_config.xml"; +#else char buf[PATH_MAX + 1]; char* configPath = GetOneCfgFile(configFileName.c_str(), buf, PATH_MAX + 1); char tmpPath[PATH_MAX + 1] = { 0 }; if (!configPath || strlen(configPath) == 0 || strlen(configPath) > PATH_MAX || !realpath(configPath, tmpPath)) { WLOGFI("[DmConfig] can not get customization config file"); - return "/usr/share/ft/window_manager/" + configFileName; + return "/system/" + configFileName; } return std::string(tmpPath); +#endif } bool DisplayManagerConfig::LoadConfigXml() diff --git a/window_manager/ft_adapter/config_policy_utils.h b/window_manager/ft_adapter/config_policy_utils.h index 6772389fe96450ed108d70d421ac3fce6f6fefbf..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/window_manager/ft_adapter/config_policy_utils.h +++ b/window_manager/ft_adapter/config_policy_utils.h @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Technologies Co., Ltd. - * 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. - */ - -#ifndef CUSTOMIZATION_CONFIG_POLICY_UTILS_H -#define CUSTOMIZATION_CONFIG_POLICY_UTILS_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif // __cplusplus - -char *GetOneCfgFile(const char *pathSuffix, char *buf, unsigned int bufLength) -{ - return nullptr; -} - -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif // __cplusplus - -#endif // CUSTOMIZATION_CONFIG_POLICY_UTILS_H diff --git a/window_manager/utils/ft_build/BUILD.gn b/window_manager/utils/ft_build/BUILD.gn index 189b479a1be308157daf675352be8a4b899b1710..f8ec2621c3aecd06c763164ba2d6f28fddf12207 100644 --- a/window_manager/utils/ft_build/BUILD.gn +++ b/window_manager/utils/ft_build/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License import("//build/gn/fangtian.gni") +import("//config.gni") config("libwmutil_private_config") { cflags = [ "-Wno-c++11-narrowing" ] diff --git a/window_manager/wm/ft_build/BUILD.gn b/window_manager/wm/ft_build/BUILD.gn index a236077ced91e7d327137f6ed257b21946abb77a..72b18c6b05b7f0840c451c1648e930bc2b6cb87b 100644 --- a/window_manager/wm/ft_build/BUILD.gn +++ b/window_manager/wm/ft_build/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") +import("//config.gni") config("libwm_private_config") { visibility = [ ":*" ] diff --git a/window_manager/wmserver/ft_build/BUILD.gn b/window_manager/wmserver/ft_build/BUILD.gn index 0cd85a1a781843b98fce8ffcb30b62e645a743ab..35335f7eca643120b3179c5c5fb956e3e4a3f7f6 100644 --- a/window_manager/wmserver/ft_build/BUILD.gn +++ b/window_manager/wmserver/ft_build/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") +import("//config.gni") config("libwms_config") { visibility = [ ":*" ] @@ -36,6 +37,8 @@ config("libwms_config") { } ft_shared_library("libwms") { + defines = ft_engine_defines + sources = [ "$window_manager_path/wm/src/zidl/window_manager_agent_proxy.cpp", "$window_manager_path/wm/src/zidl/window_proxy.cpp", diff --git a/window_manager/wmserver/src/window_manager_config.cpp b/window_manager/wmserver/src/window_manager_config.cpp index 23881a8cc1218d64f158768473c9416633bebd5e..794e090aebd233a5ef9ef565c4f816b8f2184c80 100644 --- a/window_manager/wmserver/src/window_manager_config.cpp +++ b/window_manager/wmserver/src/window_manager_config.cpp @@ -86,14 +86,18 @@ std::vector WindowManagerConfig::ReadNumberStrings(const xmlNodePtr std::string WindowManagerConfig::GetConfigPath(const std::string& configFileName) { +#ifdef _FANGTIAN + return "/usr/local/share/ft/window_manager/window_manager_config.xml"; +#else char buf[PATH_MAX + 1]; char* configPath = GetOneCfgFile(configFileName.c_str(), buf, PATH_MAX + 1); char tmpPath[PATH_MAX + 1] = { 0 }; if (!configPath || strlen(configPath) == 0 || strlen(configPath) > PATH_MAX || !realpath(configPath, tmpPath)) { WLOGFI("[WmConfig] can not get customization config file"); - return "/usr/share/ft/window_manager/" + configFileName; + return "/system/" + configFileName; } return std::string(tmpPath); +#endif } void WindowManagerConfig::ReadConfig(const xmlNodePtr& rootPtr, std::map& mapValue)