From 91c9e08900e84f1d4fc72e6e16c2fdea95853a86 Mon Sep 17 00:00:00 2001 From: abc12133 Date: Mon, 26 Jun 2023 19:24:47 +0800 Subject: [PATCH] compile wms Signed-off-by: abc12133 --- build/configs/system_deps.toml | 1 + build/gn/BUILD.gn | 4 +- .../window_animation/ft_build/BUILD.gn | 48 ++++++++ .../core/transaction/rs_interfaces.cpp | 2 +- .../core/ui/rs_surface_node.cpp | 4 +- window_manager/dm/ft_build/BUILD.gn | 2 + window_manager/dmserver/ft_build/BUILD.gn | 75 +++++++++++++ .../dmserver/src/display_manager_config.cpp | 3 +- .../ft_adapter/ability_manager_client.h | 25 +++++ window_manager/ft_adapter/common_event_data.h | 46 ++++++++ .../ft_adapter/common_event_manager.h | 44 ++++++++ .../ft_adapter/common_event_subscribe_info.h | 37 +++++++ .../ft_adapter/common_event_subscriber.h | 34 ++++++ .../ft_adapter/common_event_support.h | 31 ++++++ .../ft_adapter/config_policy_utils.h | 36 ++++++ .../ft_adapter/display_power_mgr_client.h | 40 +++++++ window_manager/ft_adapter/matching_skills.h | 34 ++++++ window_manager/ft_adapter/parameters.h | 35 ++++++ .../rs_interfaces.h => power_mgr_client.h} | 62 ++++------- ..._animation_controller.h => running_lock.h} | 26 +++-- window_manager/ft_adapter/sensor_agent.h | 102 +++++++++++++++++ window_manager/ft_adapter/skills.h | 0 window_manager/ft_adapter/snapshot.h | 50 +++++++++ ...n_finished_callback.h => socperf_client.h} | 25 +++-- window_manager/ft_adapter/ui_content.h | 1 - window_manager/ft_adapter/want.h | 54 +++++++++ .../window_manager_service_handler_stub.h | 45 ++++++++ window_manager/ft_adapter/xcollie/watchdog.h | 41 +++++++ window_manager/utils/ft_build/BUILD.gn | 6 + window_manager/utils/src/surface_draw.cpp | 12 ++ window_manager/wm/ft_build/BUILD.gn | 1 + window_manager/wmserver/ft_build/BUILD.gn | 103 ++++++++++++++++++ .../wmserver/src/input_window_monitor.cpp | 6 +- .../wmserver/src/window_common_event.cpp | 1 + .../wmserver/src/window_manager_config.cpp | 5 +- 35 files changed, 972 insertions(+), 69 deletions(-) create mode 100644 display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn create mode 100644 window_manager/dmserver/ft_build/BUILD.gn create mode 100644 window_manager/ft_adapter/common_event_data.h create mode 100644 window_manager/ft_adapter/common_event_manager.h create mode 100644 window_manager/ft_adapter/common_event_subscribe_info.h create mode 100644 window_manager/ft_adapter/common_event_subscriber.h create mode 100644 window_manager/ft_adapter/common_event_support.h create mode 100644 window_manager/ft_adapter/config_policy_utils.h create mode 100644 window_manager/ft_adapter/display_power_mgr_client.h create mode 100644 window_manager/ft_adapter/matching_skills.h create mode 100644 window_manager/ft_adapter/parameters.h rename window_manager/ft_adapter/{transaction/rs_interfaces.h => power_mgr_client.h} (42%) rename window_manager/ft_adapter/{rs_iwindow_animation_controller.h => running_lock.h} (63%) create mode 100644 window_manager/ft_adapter/sensor_agent.h create mode 100644 window_manager/ft_adapter/skills.h create mode 100644 window_manager/ft_adapter/snapshot.h rename window_manager/ft_adapter/{rs_iwindow_animation_finished_callback.h => socperf_client.h} (59%) create mode 100644 window_manager/ft_adapter/want.h create mode 100644 window_manager/ft_adapter/window_manager_service_handler_stub.h create mode 100644 window_manager/ft_adapter/xcollie/watchdog.h create mode 100644 window_manager/wmserver/ft_build/BUILD.gn diff --git a/build/configs/system_deps.toml b/build/configs/system_deps.toml index 32fbcaf..6810f40 100755 --- a/build/configs/system_deps.toml +++ b/build/configs/system_deps.toml @@ -28,6 +28,7 @@ package_deps = [ "tar", "cmake", "ninja-build", + "libxml2-devel", # DRM Backend "libdrm-devel", "systemd-devel", diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 56772fd..1d19628 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -24,9 +24,7 @@ group("ft_engine") { "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", "//display_server/rosen/modules/render_service/ft_build:librender_service", - "//window_manager/utils/ft_build:libwmutil", - "//window_manager/dm/ft_build:libdm", - "//window_manager/wm/ft_build:libwm", + "//window_manager/wmserver/ft_build:libwms", ] } diff --git a/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn b/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn new file mode 100644 index 0000000..a349e50 --- /dev/null +++ b/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn @@ -0,0 +1,48 @@ +# 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. + +import("//build/gn/fangtian.gni") +import("//display_server/ft_configs/ds_config.gni") + +config("window_animation_config") { + cflags = [ "-Wno-c++11-narrowing" ] + + include_dirs = [ + "$display_server_root/rosen/modules/animation/window_animation/include", + "$display_server_root/utils/buffer_handle/export", + ] +} + +ft_shared_library("window_animation") { + sources = [ + "../src/rs_window_animation_finish_callback_stub.cpp", + "../src/rs_window_animation_finished_callback.cpp", + "../src/rs_window_animation_finished_callback_proxy.cpp", + "../src/rs_window_animation_proxy.cpp", + "../src/rs_window_animation_stub.cpp", + "../src/rs_window_animation_target.cpp", + ] + + public_configs = [ ":window_animation_config" ] + + cflags_cc = [ "-std=c++17" ] + + public_deps = [ "$display_server_root/rosen/modules/render_service_client/ft_build:librender_service_client" ] + + configs = [ + "//build/gn/configs/system_libs:hilog_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:skia_config", + ] +} diff --git a/display_server/rosen/modules/render_service_client/core/transaction/rs_interfaces.cpp b/display_server/rosen/modules/render_service_client/core/transaction/rs_interfaces.cpp index 6881560..08d11c3 100644 --- a/display_server/rosen/modules/render_service_client/core/transaction/rs_interfaces.cpp +++ b/display_server/rosen/modules/render_service_client/core/transaction/rs_interfaces.cpp @@ -50,7 +50,7 @@ std::vector RSInterfaces::GetAllScreenIds() return renderServiceClient_->GetAllScreenIds(); } -#if !defined(__gnu_linux__) && !defined(_WIN32) && !defined(__APPLE__) +#ifndef ROSEN_CROSS_PLATFORM ScreenId RSInterfaces::CreateVirtualScreen( const std::string &name, uint32_t width, diff --git a/display_server/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp b/display_server/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp index ed8d50c..24b0d51 100644 --- a/display_server/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp +++ b/display_server/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp @@ -24,7 +24,7 @@ #include "pipeline/rs_node_map.h" #include "pipeline/rs_render_thread.h" #include "platform/common/rs_log.h" -#if !defined(__gnu_linux__) && !defined(_WIN32) && !defined(__APPLE__) +#ifndef ROSEN_CROSS_PLATFORM #include "platform/drawing/rs_surface_converter.h" #endif #include "render_context/render_context.h" @@ -314,7 +314,7 @@ bool RSSurfaceNode::CreateNodeAndSurface(const RSSurfaceRenderNodeConfig& config return (surface_ != nullptr); } -#if !defined(__gnu_linux__) && !defined(_WIN32) && !defined(__APPLE__) +#ifndef ROSEN_CROSS_PLATFORM sptr RSSurfaceNode::GetSurface() const { if (surface_ == nullptr) { diff --git a/window_manager/dm/ft_build/BUILD.gn b/window_manager/dm/ft_build/BUILD.gn index ea3f7a8..bc1ee33 100644 --- a/window_manager/dm/ft_build/BUILD.gn +++ b/window_manager/dm/ft_build/BUILD.gn @@ -21,6 +21,7 @@ config("libdm_private_config") { "$window_manager_path/dmserver/include", "$window_manager_path/ft_adapter", "$display_server_path/utils/buffer_handle/export", + "$display_server_path/rosen/modules/composer/vsync/include", ] } @@ -52,6 +53,7 @@ ft_shared_library("libdm") { "//build/gn/configs/system_libs:image_config", "//build/gn/configs/system_libs:samgr_config", "//build/gn/configs/system_libs:skia_config", + "//build/gn/configs/system_libs:eventhandler_config", ] public_configs = [ ":libdm_public_config" ] diff --git a/window_manager/dmserver/ft_build/BUILD.gn b/window_manager/dmserver/ft_build/BUILD.gn new file mode 100644 index 0000000..1e630e8 --- /dev/null +++ b/window_manager/dmserver/ft_build/BUILD.gn @@ -0,0 +1,75 @@ +# 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. + +import("//build/gn/fangtian.gni") + +config("libdms_private_config") { + cflags = [ "-Wno-c++11-narrowing" ] + + include_dirs = [ + "$window_manager_path/dm/include", + "$window_manager_path/interfaces/innerkits/dm", + "$window_manager_path/ft_adapter", + "$display_server_path/utils/buffer_handle/export", + "$display_server_path/rosen/modules/composer/vsync/include", + "/usr/include/libxml2" + ] +} + +config("libdms_public_config") { + include_dirs = [ "$window_manager_path/dmserver/include" ] +} + +ft_shared_library("libdms") { + sources = [ + "$window_manager_path/dm/src/zidl/display_manager_agent_proxy.cpp", + "$window_manager_path/dmserver/src/abstract_display.cpp", + "$window_manager_path/dmserver/src/abstract_display_controller.cpp", + "$window_manager_path/dmserver/src/abstract_screen.cpp", + "$window_manager_path/dmserver/src/abstract_screen_controller.cpp", + "$window_manager_path/dmserver/src/display_cutout_controller.cpp", + "$window_manager_path/dmserver/src/display_dumper.cpp", + "$window_manager_path/dmserver/src/display_manager_agent_controller.cpp", + "$window_manager_path/dmserver/src/display_manager_config.cpp", + "$window_manager_path/dmserver/src/display_manager_service.cpp", + "$window_manager_path/dmserver/src/display_manager_service_inner.cpp", + "$window_manager_path/dmserver/src/display_manager_stub.cpp", + "$window_manager_path/dmserver/src/display_power_controller.cpp", + "$window_manager_path/dmserver/src/screen_rotation_controller.cpp", + "$window_manager_path/dmserver/src/sensor_connector.cpp", + ] + + configs = [ + ":libdms_private_config", + "$window_manager_path/resources/config/build:coverage_flags", + "//build/gn/configs/system_libs:hilog_config", + "//build/gn/configs/system_libs:hitrace_meter_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:samgr_config", + "//build/gn/configs/system_libs:safwk_config", + "//build/gn/configs/system_libs:eventhandler_config", + "//build/gn/configs/system_libs:skia_config", + ] + + public_configs = [ ":libdms_public_config" ] + + libs = [ "xml2" ] + + deps = [ + "$display_server_path/frameworks/surface/ft_build:surface", + "$display_server_path/rosen/modules/render_service_base/ft_build:librender_service_base", + "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", + "$window_manager_path/utils/ft_build:libwmutil", + ] +} diff --git a/window_manager/dmserver/src/display_manager_config.cpp b/window_manager/dmserver/src/display_manager_config.cpp index 30afb6c..0718d40 100644 --- a/window_manager/dmserver/src/display_manager_config.cpp +++ b/window_manager/dmserver/src/display_manager_config.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ std::string DisplayManagerConfig::GetConfigPath(const std::string& configFileNam 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 "/system/" + configFileName; + return "/usr/share/ft/window_manager/" + configFileName; } return std::string(tmpPath); } diff --git a/window_manager/ft_adapter/ability_manager_client.h b/window_manager/ft_adapter/ability_manager_client.h index e914606..2d46350 100644 --- a/window_manager/ft_adapter/ability_manager_client.h +++ b/window_manager/ft_adapter/ability_manager_client.h @@ -16,6 +16,14 @@ #ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_CLIENT_H #define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_CLIENT_H +#include +#include + +#include "ability_info.h" +#include "want.h" +#include "snapshot.h" +#include "window_manager_service_handler_stub.h" + namespace OHOS { namespace AbilityRuntime { class AbilityContext { @@ -77,6 +85,23 @@ public: { return 0; } + int32_t TerminateAbility(const sptr &token, int resultCode, const Want *resultWant) + { + return 0; + } + int32_t CloseAbility(const sptr &token, int resultCode = -1, const Want *resultWant = nullptr) + { + return 0; + } + int32_t RegisterSnapshotHandler(const sptr& handler) + { + return 0; + } + int32_t RegisterWindowManagerServiceHandler(const sptr& handler) + { + return 0; + } + void CompleteFirstFrameDrawing(const sptr &abilityToken) {} }; } // namespace AAFwk } // namespace OHOS diff --git a/window_manager/ft_adapter/common_event_data.h b/window_manager/ft_adapter/common_event_data.h new file mode 100644 index 0000000..a7db8a5 --- /dev/null +++ b/window_manager/ft_adapter/common_event_data.h @@ -0,0 +1,46 @@ +/* + * 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 COMMON_EVENT_DATA_H +#define COMMON_EVENT_DATA_H + +#include "parcel.h" +#include "want.h" + +namespace OHOS { +namespace EventFwk { +using Want = OHOS::AAFwk::Want; + +class CommonEventData : public Parcelable { +public: + void SetWant(const Want &want) {} + const Want &GetWant() const + { + static Want want; + return want; + } + int32_t GetCode() const + { + return 0; + } + bool Marshalling(Parcel &parcel) const override + { + return true; + } +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // COMMON_EVENT_DATA_H \ No newline at end of file diff --git a/window_manager/ft_adapter/common_event_manager.h b/window_manager/ft_adapter/common_event_manager.h new file mode 100644 index 0000000..8afc8c8 --- /dev/null +++ b/window_manager/ft_adapter/common_event_manager.h @@ -0,0 +1,44 @@ +/* + * 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 COMMON_EVENT_MANAGER_H +#define COMMON_EVENT_MANAGER_H + +#include + +#include "common_event_data.h" +#include "common_event_subscriber.h" + +namespace OHOS { +namespace EventFwk { +class CommonEventManager { +public: + static bool PublishCommonEvent(const CommonEventData &data) + { + return true; + } + static bool SubscribeCommonEvent(const std::shared_ptr &subscriber) + { + return true; + } + static bool UnSubscribeCommonEvent(const std::shared_ptr &subscriber) + { + return true; + } +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // COMMON_EVENT_MANAGER_H diff --git a/window_manager/ft_adapter/common_event_subscribe_info.h b/window_manager/ft_adapter/common_event_subscribe_info.h new file mode 100644 index 0000000..26f7ac1 --- /dev/null +++ b/window_manager/ft_adapter/common_event_subscribe_info.h @@ -0,0 +1,37 @@ +/* + * 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 COMMON_EVENT_SUBSCRIBE_INFO_H +#define COMMON_EVENT_SUBSCRIBE_INFO_H + +#include "matching_skills.h" + +namespace OHOS { +namespace EventFwk { +class CommonEventSubscribeInfo : public Parcelable { +public: + CommonEventSubscribeInfo(const MatchingSkills &matchingSkills) {}; + explicit CommonEventSubscribeInfo(const CommonEventSubscribeInfo &commonEventSubscribeInfo); + virtual ~CommonEventSubscribeInfo() = default; + + bool Marshalling(Parcel &parcel) const override + { + return true; + } +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // COMMON_EVENT_SUBSCRIBE_INFO_H diff --git a/window_manager/ft_adapter/common_event_subscriber.h b/window_manager/ft_adapter/common_event_subscriber.h new file mode 100644 index 0000000..f34691f --- /dev/null +++ b/window_manager/ft_adapter/common_event_subscriber.h @@ -0,0 +1,34 @@ +/* + * 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 COMMON_EVENT_SUBSCRIBER_H +#define COMMON_EVENT_SUBSCRIBER_H + +#include "common_event_data.h" +#include "common_event_subscribe_info.h" + +namespace OHOS { +namespace EventFwk { +class CommonEventSubscriber { +public: + CommonEventSubscriber(const CommonEventSubscribeInfo &subscribeInfo) {}; + virtual ~CommonEventSubscriber() = default; + + virtual void OnReceiveEvent(const CommonEventData &data) = 0; +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // COMMON_EVENT_SUBSCRIBER_H diff --git a/window_manager/ft_adapter/common_event_support.h b/window_manager/ft_adapter/common_event_support.h new file mode 100644 index 0000000..077bc68 --- /dev/null +++ b/window_manager/ft_adapter/common_event_support.h @@ -0,0 +1,31 @@ +/* + * 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 COMMON_EVENT_SUPPORT_H +#define COMMON_EVENT_SUPPORT_H + +#include +#include + +namespace OHOS { +namespace EventFwk { +class CommonEventSupport { +public: + static const std::string COMMON_EVENT_USER_SWITCHED; +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // COMMON_EVENT_SUPPORT_H \ No newline at end of file diff --git a/window_manager/ft_adapter/config_policy_utils.h b/window_manager/ft_adapter/config_policy_utils.h new file mode 100644 index 0000000..6772389 --- /dev/null +++ b/window_manager/ft_adapter/config_policy_utils.h @@ -0,0 +1,36 @@ +/* + * 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/ft_adapter/display_power_mgr_client.h b/window_manager/ft_adapter/display_power_mgr_client.h new file mode 100644 index 0000000..fb5a3e7 --- /dev/null +++ b/window_manager/ft_adapter/display_power_mgr_client.h @@ -0,0 +1,40 @@ +/* + * 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 DISPLAYMGR_DISPLAY_MGR_CLIENT_H +#define DISPLAYMGR_DISPLAY_MGR_CLIENT_H + +#include + +namespace OHOS { +namespace DisplayPowerMgr { +class DisplayPowerMgrClient { +public: + static DisplayPowerMgrClient& GetInstance() { + static DisplayPowerMgrClient client; + return client; + } + bool OverrideBrightness(uint32_t value, uint32_t displayId = 0) + { + return true; + } + bool RestoreBrightness(uint32_t displayId = 0) + { + return true; + } +}; +} // namespace DisplayPowerMgr +} // namespace OHOS +#endif // DISPLAYMGR_GRADUAL_ANIMATOR_H diff --git a/window_manager/ft_adapter/matching_skills.h b/window_manager/ft_adapter/matching_skills.h new file mode 100644 index 0000000..42c98c3 --- /dev/null +++ b/window_manager/ft_adapter/matching_skills.h @@ -0,0 +1,34 @@ +/* + * 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 MATCHING_SKILLS_H +#define MATCHING_SKILLS_H + +#include "parcel.h" + +namespace OHOS { +namespace EventFwk { +class MatchingSkills : public Parcelable { +public: + void AddEvent(const std::string &event) {} + bool Marshalling(Parcel &parcel) const override + { + return true; + } +}; +} // namespace EventFwk +} // namespace OHOS + +#endif // MATCHING_SKILLS_H \ No newline at end of file diff --git a/window_manager/ft_adapter/parameters.h b/window_manager/ft_adapter/parameters.h new file mode 100644 index 0000000..ef67548 --- /dev/null +++ b/window_manager/ft_adapter/parameters.h @@ -0,0 +1,35 @@ +/* + * 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 SYSTEM_PARAMETERS_H +#define SYSTEM_PARAMETERS_H + +#include +#include + +namespace OHOS { +namespace system { +static std::string GetParameter(const std::string& key, const std::string& def) +{ + return ""; +} +static bool SetParameter(const std::string& key, const std::string& value) +{ + return true; +} +} // namespace system +} // namespace OHOS + +#endif // SYSTEM_PARAMETERS_H \ No newline at end of file diff --git a/window_manager/ft_adapter/transaction/rs_interfaces.h b/window_manager/ft_adapter/power_mgr_client.h similarity index 42% rename from window_manager/ft_adapter/transaction/rs_interfaces.h rename to window_manager/ft_adapter/power_mgr_client.h index 04eec55..41a7c6e 100644 --- a/window_manager/ft_adapter/transaction/rs_interfaces.h +++ b/window_manager/ft_adapter/power_mgr_client.h @@ -13,59 +13,41 @@ * limitations under the License. */ -#ifndef RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_INTERFACES_H -#define RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_INTERFACES_H +#ifndef POWERMGR_POWER_MGR_CLIENT_H +#define POWERMGR_POWER_MGR_CLIENT_H -#include - -class RSSurfaceNode; +#include namespace OHOS { -namespace AppExecFwk { -class EventHandler; -} -} +namespace PowerMgr { +enum class WakeupDeviceType : uint32_t { + WAKEUP_DEVICE_APPLICATION = 2, +}; -namespace OHOS { -namespace Rosen { -class VSyncReceiver; -class SurfaceCaptureCallback; +enum class RunningLockType : uint32_t { + RUNNINGLOCK_SCREEN = 0, +}; -class RSInterfaces { +class PowerMgrClient { public: - static RSInterfaces &GetInstance() - { - static RSInterfaces instance; - return instance; - }; - - int32_t GetScreenBacklight(uint32_t id) + static PowerMgrClient& GetInstance() { + static PowerMgrClient client; + return client; + } + int32_t WakeupDevice(WakeupDeviceType reason = WakeupDeviceType::WAKEUP_DEVICE_APPLICATION, + const std::string& detail = std::string("app call")) { return 0; } - - void SetScreenBacklight(uint32_t id, uint32_t level) + bool IsScreenOn() { - return; + return true; } - - std::shared_ptr CreateVSyncReceiver( - const std::string& name, const std::shared_ptr &looper = nullptr) + std::shared_ptr CreateRunningLock(const std::string& name, RunningLockType type) { return nullptr; } - - bool TakeSurfaceCapture(std::shared_ptr node, - std::shared_ptr callback, float scaleX = 1.0f, float scaleY = 1.0f) - { - return true; - } - -private: - RSInterfaces() = default; - ~RSInterfaces() noexcept {}; }; -} // namespace Rosen +} // namespace PowerMgr } // namespace OHOS - -#endif // RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_INTERFACES_H +#endif // POWERMGR_POWER_MGR_CLIENT_H diff --git a/window_manager/ft_adapter/rs_iwindow_animation_controller.h b/window_manager/ft_adapter/running_lock.h similarity index 63% rename from window_manager/ft_adapter/rs_iwindow_animation_controller.h rename to window_manager/ft_adapter/running_lock.h index 2c3ecc6..32661f1 100644 --- a/window_manager/ft_adapter/rs_iwindow_animation_controller.h +++ b/window_manager/ft_adapter/running_lock.h @@ -13,18 +13,26 @@ * limitations under the License. */ -#ifndef WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H -#define WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H +#ifndef POWERMGR_RUNNING_LOCK_H +#define POWERMGR_RUNNING_LOCK_H -#include +#include +#include +#include namespace OHOS { -namespace Rosen { -class RSIWindowAnimationController : public IRemoteBroker { +namespace PowerMgr { +class RunningLock { public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.rosen.RSIWindowAnimationController"); + ErrCode Lock(int32_t timeOutMs = -1) + { + return 0; + } + ErrCode UnLock() + { + return 0; + } }; -} // namespace Rosen +} // namespace PowerMgr } // namespace OHOS - -#endif // WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H +#endif // POWERMGR_RUNNING_LOCK_H diff --git a/window_manager/ft_adapter/sensor_agent.h b/window_manager/ft_adapter/sensor_agent.h new file mode 100644 index 0000000..b1cb700 --- /dev/null +++ b/window_manager/ft_adapter/sensor_agent.h @@ -0,0 +1,102 @@ +/* + * 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 SENSOR_AGENT_H +#define SENSOR_AGENT_H + +#include + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif + +#ifndef SENSOR_USER_DATA_SIZE +#define SENSOR_USER_DATA_SIZE 104 +#endif + +#ifndef NAME_MAX_LEN +#define NAME_MAX_LEN 128 +#endif + +typedef enum SensorTypeId { + SENSOR_TYPE_ID_GRAVITY = 257, +} SensorTypeId; + +typedef enum SensorMode { + SENSOR_ON_CHANGE = 2, +} SensorMode; + +typedef struct SensorEvent { + int32_t sensorTypeId; + int32_t version; + int64_t timestamp; + uint32_t option; + int32_t mode; + uint8_t *data = nullptr; + uint32_t dataLen; +} SensorEvent; + +typedef struct GravityData { + float x; + float y; + float z; +} GravityData; + +typedef void (*RecordSensorCallback)(SensorEvent *event); + +typedef struct UserData { + char userData[SENSOR_USER_DATA_SIZE]; +} UserData; + +typedef struct SensorUser { + char name[NAME_MAX_LEN]; + RecordSensorCallback callback; + UserData *userData = nullptr; +} SensorUser; + +static int32_t SubscribeSensor(int32_t sensorTypeId, const SensorUser *user) +{ + return 0; +} +static int32_t UnsubscribeSensor(int32_t sensorTypeId, const SensorUser *user) +{ + return 0; +} +static int32_t SetBatch(int32_t sensorTypeId, const SensorUser *user, int64_t samplingInterval, int64_t reportInterval) +{ + return 0; +} +static int32_t ActivateSensor(int32_t sensorTypeId, const SensorUser *user) +{ + return 0; +} +static int32_t DeactivateSensor(int32_t sensorTypeId, const SensorUser *user) +{ + return 0; +} +static int32_t SetMode(int32_t sensorTypeId, const SensorUser *user, int32_t mode) +{ + return 0; +} + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif +#endif /* SENSOR_AGENT_H */ +/** @} */ \ No newline at end of file diff --git a/window_manager/ft_adapter/skills.h b/window_manager/ft_adapter/skills.h new file mode 100644 index 0000000..e69de29 diff --git a/window_manager/ft_adapter/snapshot.h b/window_manager/ft_adapter/snapshot.h new file mode 100644 index 0000000..00ba02e --- /dev/null +++ b/window_manager/ft_adapter/snapshot.h @@ -0,0 +1,50 @@ +/* + * 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 OHOS_ABILITY_RUNTIME_SNAPSHOT_H +#define OHOS_ABILITY_RUNTIME_SNAPSHOT_H + +#include + +#include "pixel_map.h" + +namespace OHOS { +namespace AAFwk { +class Snapshot { +public: + Snapshot() = default; + ~Snapshot() = default; + const std::shared_ptr& GetPixelMap() const + { + return pixelMap_; + } + void SetPixelMap(const std::shared_ptr& pixelMap) {} +private: + std::shared_ptr pixelMap_ = nullptr; +}; + +class ISnapshotHandler : public OHOS::IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.SnapshotHandler"); + + enum { + TRANS_ID_GET_SNAPSHOT + }; + + virtual int32_t GetSnapshot(const sptr& token, Snapshot& snapshot) = 0; +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_SNAPSHOT_H diff --git a/window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h b/window_manager/ft_adapter/socperf_client.h similarity index 59% rename from window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h rename to window_manager/ft_adapter/socperf_client.h index 42c3972..44bda4d 100644 --- a/window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h +++ b/window_manager/ft_adapter/socperf_client.h @@ -13,20 +13,25 @@ * limitations under the License. */ -#ifndef WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H -#define WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H +#ifndef SOC_PERF_CLIENT +#define SOC_PERF_CLIENT -#include +#include +#include namespace OHOS { -namespace Rosen { -struct RSWindowAnimationTarget; - -class RSIWindowAnimationFinishedCallback : public IRemoteBroker { +namespace SOCPERF { +class SocPerfClient { public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.rosen.RSIWindowAnimationFinishedCallback"); + void PerfRequest(int32_t cmdId, const std::string& msg) {} + void PerfRequestEx(int32_t cmdId, bool onOffTag, const std::string& msg) {} + + static SocPerfClient& GetInstance() { + static SocPerfClient client; + return client; + } }; -} // namespace Rosen +} // namespace SOCPERF } // namespace OHOS -#endif // WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H +#endif // SOC_PERF_CLIENT diff --git a/window_manager/ft_adapter/ui_content.h b/window_manager/ft_adapter/ui_content.h index 0ed7382..94c3f90 100644 --- a/window_manager/ft_adapter/ui_content.h +++ b/window_manager/ft_adapter/ui_content.h @@ -19,7 +19,6 @@ #include #include #include - #include class NativeValue; diff --git a/window_manager/ft_adapter/want.h b/window_manager/ft_adapter/want.h new file mode 100644 index 0000000..ef12714 --- /dev/null +++ b/window_manager/ft_adapter/want.h @@ -0,0 +1,54 @@ +/* + * 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 OHOS_ABILITY_BASE_WANT_H +#define OHOS_ABILITY_BASE_WANT_H + +#include "parcel.h" +#include "iremote_object.h" + +namespace OHOS { +namespace AAFwk { +class Want final : public Parcelable { +public: + std::string GetAction() const + { + return ""; + } + Want &SetAction(const std::string &action) + { + return *this; + } + Want& SetParam(const std::string& key, const sptr& remoteObject) + { + return *this; + } + Want &SetParam(const std::string &key, int value) + { + return *this; + } + Want &SetParam(const std::string &key, const std::string &value) + { + return *this; + } + bool Marshalling(Parcel &parcel) const override + { + return true; + } +}; +} // namespace AAFwk +} // namespace OHOS + +#endif // OHOS_ABILITY_BASE_WANT_H \ No newline at end of file diff --git a/window_manager/ft_adapter/window_manager_service_handler_stub.h b/window_manager/ft_adapter/window_manager_service_handler_stub.h new file mode 100644 index 0000000..092f200 --- /dev/null +++ b/window_manager/ft_adapter/window_manager_service_handler_stub.h @@ -0,0 +1,45 @@ +/* + * 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 OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_STUB_H +#define OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_STUB_H + +#include "iremote_stub.h" +#include "iremote_broker.h" +#include "window_info.h" +#include "pixel_map.h" + +namespace OHOS { +namespace AAFwk { +class IWindowManagerServiceHandler : public OHOS::IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.WindowManagerServiceHandler"); + + virtual void NotifyWindowTransition(sptr fromInfo, sptr toInfo) = 0; + virtual int32_t GetFocusWindow(sptr& abilityToken) = 0; + virtual void StartingWindow(sptr info, + std::shared_ptr pixelMap, uint32_t bgColor) = 0; + virtual void StartingWindow(sptr info, std::shared_ptr pixelMap) = 0; + virtual void CancelStartingWindow(sptr abilityToken) = 0; +}; + +class WindowManagerServiceHandlerStub : public IRemoteStub { +public: + WindowManagerServiceHandlerStub() = default; + virtual ~WindowManagerServiceHandlerStub() = default; +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_STUB_H diff --git a/window_manager/ft_adapter/xcollie/watchdog.h b/window_manager/ft_adapter/xcollie/watchdog.h new file mode 100644 index 0000000..6594ce9 --- /dev/null +++ b/window_manager/ft_adapter/xcollie/watchdog.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021-2022 Huawei Device 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 RELIABILITY_WATCHDOG_H +#define RELIABILITY_WATCHDOG_H + +#include +#include "event_handler.h" + +using TimeOutCallback = std::function; +namespace OHOS { +namespace HiviewDFX { +class Watchdog { + static const uint64_t WATCHDOG_TIMEVAL = 30000; +public: + static Watchdog& GetInstance() { + static Watchdog client; + return client; + } + int AddThread(const std::string &name, std::shared_ptr handler, + TimeOutCallback timeOutCallback = nullptr, uint64_t interval = WATCHDOG_TIMEVAL) + { + return 0; + } +}; +} // end of namespace HiviewDFX +} // end of namespace OHOS +#endif + diff --git a/window_manager/utils/ft_build/BUILD.gn b/window_manager/utils/ft_build/BUILD.gn index f1db17c..189b479 100644 --- a/window_manager/utils/ft_build/BUILD.gn +++ b/window_manager/utils/ft_build/BUILD.gn @@ -21,7 +21,10 @@ config("libwmutil_private_config") { "$window_manager_path/interfaces/innerkits/dm", "$window_manager_path/interfaces/innerkits/wm", "$window_manager_path/ft_adapter", + "$display_server_path/rosen/modules/composer/vsync/include", "$display_server_path/utils/buffer_handle/export", + "$display_server_path/rosen/modules/2d_graphics/include", + "$display_server_path/rosen/modules/2d_graphics/src", ] } @@ -41,6 +44,7 @@ ft_shared_library("libwmutil") { "$window_manager_path/utils/src/screenshot_info.cpp", "$window_manager_path/utils/src/singleton_container.cpp", "$window_manager_path/utils/src/string_util.cpp", + "$window_manager_path/utils/src/surface_draw.cpp", "$window_manager_path/utils/src/surface_reader.cpp", "$window_manager_path/utils/src/surface_reader_handler_impl.cpp", "$window_manager_path/utils/src/sys_cap_util.cpp", @@ -48,6 +52,7 @@ ft_shared_library("libwmutil") { "$window_manager_path/utils/src/window_transition_info.cpp", "$window_manager_path/utils/src/wm_math.cpp", "$window_manager_path/utils/src/wm_occlusion_region.cpp", + "$window_manager_path/utils/src/xml_config_base.cpp", ] configs = [ @@ -57,6 +62,7 @@ ft_shared_library("libwmutil") { "//build/gn/configs/system_libs:c_utils_config", "//build/gn/configs/system_libs:ipc_core_config", "//build/gn/configs/system_libs:samgr_config", + "//build/gn/configs/system_libs:skia_config", "//build/gn/configs/system_libs:eventhandler_config", "//build/gn/configs/system_libs:image_config", "//build/gn/configs/system_libs:mmi_config", diff --git a/window_manager/utils/src/surface_draw.cpp b/window_manager/utils/src/surface_draw.cpp index f56a047..df36257 100644 --- a/window_manager/utils/src/surface_draw.cpp +++ b/window_manager/utils/src/surface_draw.cpp @@ -180,6 +180,7 @@ std::unique_ptr SurfaceDraw::DecodeImageToPixelMap(const void SurfaceDraw::DrawPixelmap(Drawing::Canvas &canvas, const std::string& imagePath) { +#if 0 std::unique_ptr pixelmap = DecodeImageToPixelMap(imagePath); if (pixelmap == nullptr) { WLOGFE("drawing pixel map is nullptr"); @@ -192,10 +193,12 @@ void SurfaceDraw::DrawPixelmap(Drawing::Canvas &canvas, const std::string& image pen.SetWidth(penWidth); canvas.AttachPen(pen); canvas.DrawBitmap(*pixelmap, 0, 0); +#endif } bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, const std::string& imagePath) { +#if 0 Drawing::Bitmap bitmap; Drawing::BitmapFormat format { Drawing::ColorType::COLORTYPE_RGBA_8888, Drawing::AlphaType::ALPHATYPE_OPAQUE }; @@ -210,11 +213,13 @@ bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, const s WLOGFE("draw failed"); return false; } +#endif return true; } bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, std::shared_ptr pixelMap) { +#if 0 Drawing::Bitmap bitmap; Drawing::Canvas canvas; Drawing::BitmapFormat format { Drawing::ColorType::COLORTYPE_RGBA_8888, Drawing::AlphaType::ALPHATYPE_OPAQUE }; @@ -240,11 +245,13 @@ bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, std::sh WLOGFE("draw failed"); return false; } +#endif return true; } bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, uint32_t color) { +#if 0 Drawing::Bitmap bitmap; Drawing::BitmapFormat format { Drawing::ColorType::COLORTYPE_RGBA_8888, Drawing::AlphaType::ALPHATYPE_OPAQUE }; @@ -259,6 +266,7 @@ bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, uint32_ WLOGFE("draw failed"); return false; } +#endif return true; } @@ -297,6 +305,7 @@ bool SurfaceDraw::DrawImageRect(std::shared_ptr surfaceNode, Rect bool SurfaceDraw::DoDrawImageRect(sptr buffer, const Rect& rect, std::shared_ptr pixelMap, uint32_t color, bool fillWindow) { +#if 0 int32_t winWidth = static_cast(rect.width_); int32_t winHeight = static_cast(rect.height_); // actual width of the surface buffer after alignment @@ -344,6 +353,7 @@ bool SurfaceDraw::DoDrawImageRect(sptr buffer, const Rect& WLOGFE("draw image rect failed, because copy bitmap to buffer failed."); return false; } +#endif return true; } @@ -368,6 +378,7 @@ bool SurfaceDraw::GetSurfaceSnapshot(const std::shared_ptr surfac bool SurfaceDraw::DrawMasking(std::shared_ptr surfaceNode, Rect screenRect, Rect transparentRect) { +#if 0 int32_t screenHeight = static_cast(screenRect.height_); int32_t screenWidth = static_cast(screenRect.width_); int32_t transparentHeight = static_cast(transparentRect.height_); @@ -414,6 +425,7 @@ bool SurfaceDraw::DrawMasking(std::shared_ptr surfaceNode, Rect s WLOGFE("draw masking FlushBuffer ret:%{public}s", SurfaceErrorStr(surfaceRet).c_str()); return false; } +#endif return true; } } // Rosen diff --git a/window_manager/wm/ft_build/BUILD.gn b/window_manager/wm/ft_build/BUILD.gn index f33b208..a236077 100644 --- a/window_manager/wm/ft_build/BUILD.gn +++ b/window_manager/wm/ft_build/BUILD.gn @@ -71,6 +71,7 @@ ft_shared_library("libwm") { public_configs = [ ":libwm_public_config" ] deps = [ + "$display_server_path/rosen/modules/animation/window_animation/ft_build:window_animation", "$display_server_path/rosen/modules/render_service_base/ft_build:librender_service_base", "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", "$window_manager_path/dm/ft_build:libdm", diff --git a/window_manager/wmserver/ft_build/BUILD.gn b/window_manager/wmserver/ft_build/BUILD.gn new file mode 100644 index 0000000..0cd85a1 --- /dev/null +++ b/window_manager/wmserver/ft_build/BUILD.gn @@ -0,0 +1,103 @@ +# 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. + +import("//build/gn/fangtian.gni") + +config("libwms_config") { + visibility = [ ":*" ] + + cflags = [ "-Wno-c++11-narrowing" ] + + include_dirs = [ + "$window_manager_path/wmserver/include", + "$window_manager_path/wmserver/include/window_snapshot", + "$window_manager_path/interfaces/innerkits/wm", + "$window_manager_path/interfaces/innerkits/dm", + "$window_manager_path/ft_adapter", + "$window_manager_path/wm/include", + "$window_manager_path/utils/include", + "$window_manager_path/dm/include", + "$display_server_path/utils/buffer_handle/export", + "$display_server_path/rosen/modules/composer/vsync/include", + "$display_server_path/rosen/modules/2d_graphics/include", + "$display_server_path/rosen/modules/2d_graphics/src", + "/usr/include/libxml2", + ] +} + +ft_shared_library("libwms") { + sources = [ + "$window_manager_path/wm/src/zidl/window_manager_agent_proxy.cpp", + "$window_manager_path/wm/src/zidl/window_proxy.cpp", + "$window_manager_path/wmserver/src/accessibility_connection.cpp", + "$window_manager_path/wmserver/src/avoid_area_controller.cpp", + "$window_manager_path/wmserver/src/display_group_controller.cpp", + "$window_manager_path/wmserver/src/display_group_info.cpp", + "$window_manager_path/wmserver/src/display_zoom_controller.cpp", + "$window_manager_path/wmserver/src/drag_controller.cpp", + "$window_manager_path/wmserver/src/freeze_controller.cpp", + "$window_manager_path/wmserver/src/inner_window.cpp", + "$window_manager_path/wmserver/src/input_window_monitor.cpp", + "$window_manager_path/wmserver/src/memory_guard.cpp", + "$window_manager_path/wmserver/src/minimize_app.cpp", + "$window_manager_path/wmserver/src/remote_animation.cpp", + "$window_manager_path/wmserver/src/starting_window.cpp", + "$window_manager_path/wmserver/src/window_common_event.cpp", + "$window_manager_path/wmserver/src/window_controller.cpp", + "$window_manager_path/wmserver/src/window_dumper.cpp", + "$window_manager_path/wmserver/src/window_inner_manager.cpp", + "$window_manager_path/wmserver/src/window_layout_policy.cpp", + "$window_manager_path/wmserver/src/window_layout_policy_cascade.cpp", + "$window_manager_path/wmserver/src/window_layout_policy_tile.cpp", + "$window_manager_path/wmserver/src/window_manager_agent_controller.cpp", + "$window_manager_path/wmserver/src/window_manager_config.cpp", + "$window_manager_path/wmserver/src/window_manager_service.cpp", + "$window_manager_path/wmserver/src/window_node.cpp", + "$window_manager_path/wmserver/src/window_node_container.cpp", + "$window_manager_path/wmserver/src/window_node_state_machine.cpp", + "$window_manager_path/wmserver/src/window_pair.cpp", + "$window_manager_path/wmserver/src/window_root.cpp", + "$window_manager_path/wmserver/src/window_snapshot/snapshot_controller.cpp", + "$window_manager_path/wmserver/src/window_snapshot/snapshot_proxy.cpp", + "$window_manager_path/wmserver/src/window_snapshot/snapshot_stub.cpp", + "$window_manager_path/wmserver/src/window_zorder_policy.cpp", + "$window_manager_path/wmserver/src/zidl/ressched_report.cpp", + "$window_manager_path/wmserver/src/zidl/window_manager_stub.cpp", + ] + + configs = [ + ":libwms_config", + "$window_manager_path/resources/config/build:coverage_flags", + "//build/gn/configs/system_libs:hilog_config", + "//build/gn/configs/system_libs:hitrace_meter_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:samgr_config", + "//build/gn/configs/system_libs:safwk_config", + "//build/gn/configs/system_libs:eventhandler_config", + "//build/gn/configs/system_libs:skia_config", + "//build/gn/configs/system_libs:image_config", + "//build/gn/configs/system_libs:mmi_config", + ] + + libs = [ "xml2" ] + + deps = [ + "$display_server_path/rosen/modules/animation/window_animation/ft_build:window_animation", + "$display_server_path/rosen/modules/render_service_base/ft_build:librender_service_base", + "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", + "$window_manager_path/dmserver/ft_build:libdms", + "$window_manager_path/utils/ft_build:libwmutil", + "$window_manager_path/wm/ft_build:libwm", + ] +} diff --git a/window_manager/wmserver/src/input_window_monitor.cpp b/window_manager/wmserver/src/input_window_monitor.cpp index 1aeac9a..45262ae 100644 --- a/window_manager/wmserver/src/input_window_monitor.cpp +++ b/window_manager/wmserver/src/input_window_monitor.cpp @@ -15,6 +15,7 @@ #include "input_window_monitor.h" +#include #include #include @@ -139,13 +140,16 @@ void InputWindowMonitor::UpdateDisplayInfo(const std::vector>& displayInfo->GetRotation() == Rotation::ROTATION_270) { std::swap(displayWidth, displayHeight); } + std::stringstream oss; + oss << "display "; + oss << displayInfo->GetDisplayId(); MMI::DisplayInfo display = { .id = static_cast(displayInfo->GetDisplayId()), .x = offsetX, .y = offsetY, .width = static_cast(displayWidth), .height = static_cast(displayHeight), - .name = (std::stringstream("display ")<GetDisplayId()).str(), + .name = oss.str(), .uniq = "default" + std::to_string(displayInfo->GetDisplayId()), .direction = GetDisplayDirectionForMmi(displayInfo->GetRotation()), }; diff --git a/window_manager/wmserver/src/window_common_event.cpp b/window_manager/wmserver/src/window_common_event.cpp index a48962d..07ea6d8 100644 --- a/window_manager/wmserver/src/window_common_event.cpp +++ b/window_manager/wmserver/src/window_common_event.cpp @@ -24,6 +24,7 @@ #include "window_manager_service.h" namespace OHOS { +const std::string EventFwk::CommonEventSupport::COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED"; namespace Rosen { namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowCommonEvent"}; diff --git a/window_manager/wmserver/src/window_manager_config.cpp b/window_manager/wmserver/src/window_manager_config.cpp index e004dc4..23881a8 100644 --- a/window_manager/wmserver/src/window_manager_config.cpp +++ b/window_manager/wmserver/src/window_manager_config.cpp @@ -14,6 +14,9 @@ */ #include "window_manager_config.h" + +#include + #include "config_policy_utils.h" #include "window_helper.h" #include "window_manager_hilog.h" @@ -88,7 +91,7 @@ std::string WindowManagerConfig::GetConfigPath(const std::string& configFileName 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 "/system/" + configFileName; + return "/usr/share/ft/window_manager/" + configFileName; } return std::string(tmpPath); } -- Gitee