From 74ce65810984954e6e9bfdd2a1e0548137f5557a Mon Sep 17 00:00:00 2001 From: abc12133 Date: Sun, 25 Jun 2023 15:22:31 +0800 Subject: [PATCH] compile libwm Signed-off-by: abc12133 --- build/gn/BUILD.gn | 1 + build/gn/fangtian.gni | 2 + .../core/ui/rs_surface_node.cpp | 2 +- window_manager/dm/ft_build/BUILD.gn | 38 +++--- window_manager/dm/src/display.cpp | 1 - window_manager/ft_adapter/ability_context.h | 24 ++++ window_manager/ft_adapter/ability_info.h | 15 +++ .../ft_adapter/ability_manager_client.h | 83 +++++++++++++ .../rs_iwindow_animation_controller.h | 30 +++++ .../rs_iwindow_animation_finished_callback.h | 32 +++++ .../ft_adapter/transaction/rs_interfaces.h | 25 +++- window_manager/ft_adapter/ui_content.h | 110 ++++++++++++++++++ .../interfaces/innerkits/dm/display.h | 33 +++++- window_manager/utils/ft_build/BUILD.gn | 55 +++++---- window_manager/utils/include/display_info.h | 36 ------ window_manager/wm/ft_build/BUILD.gn | 79 +++++++++++++ window_manager/wm/src/window_impl.cpp | 1 - .../wm/src/window_manager_agent.cpp | 2 +- 18 files changed, 477 insertions(+), 92 deletions(-) create mode 100644 window_manager/ft_adapter/ability_context.h create mode 100644 window_manager/ft_adapter/ability_manager_client.h create mode 100644 window_manager/ft_adapter/rs_iwindow_animation_controller.h create mode 100644 window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h create mode 100644 window_manager/ft_adapter/ui_content.h create mode 100644 window_manager/wm/ft_build/BUILD.gn diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index f3a53d2..4a4f5c8 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -25,6 +25,7 @@ group("ft_engine") { "//window_manager/utils/ft_build:libwmutil", "//window_manager/dm/ft_build:libdm", + "//window_manager/wm/ft_build:libwm", ] } diff --git a/build/gn/fangtian.gni b/build/gn/fangtian.gni index eed273c..633f18a 100755 --- a/build/gn/fangtian.gni +++ b/build/gn/fangtian.gni @@ -15,4 +15,6 @@ 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/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 20f9ee0..ed8d50c 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 @@ -188,7 +188,7 @@ bool RSSurfaceNode::GetSecurityLayer() const return isSecurityLayer_; } -#if !defined(__gnu_linux__) && !defined(_WIN32) && !defined(__APPLE__) +#ifndef ROSEN_CROSS_PLATFORM void RSSurfaceNode::SetColorSpace(ColorGamut colorSpace) { colorSpace_ = colorSpace; diff --git a/window_manager/dm/ft_build/BUILD.gn b/window_manager/dm/ft_build/BUILD.gn index b958cf3..ea3f7a8 100644 --- a/window_manager/dm/ft_build/BUILD.gn +++ b/window_manager/dm/ft_build/BUILD.gn @@ -17,38 +17,35 @@ config("libdm_private_config") { cflags = [ "-Wno-c++11-narrowing" ] include_dirs = [ - "//window_manager/dm/include", - "//window_manager/dmserver/include", - "//window_manager/ft_adapter", - "//display_server/interfaces/inner_api/surface", - "//display_server/interfaces/inner_api/common", - "//display_server/utils/buffer_handle/export", - "//display_server/rosen/modules/render_service_base/include", + "$window_manager_path/dm/include", + "$window_manager_path/dmserver/include", + "$window_manager_path/ft_adapter", + "$display_server_path/utils/buffer_handle/export", ] } config("libdm_public_config") { include_dirs = [ - "//window_manager/interfaces/innerkits/dm", - "//window_manager/utils/include", + "$window_manager_path/interfaces/innerkits/dm", + "$window_manager_path/utils/include", ] } ft_shared_library("libdm") { sources = [ - "//window_manager/dm/src/display.cpp", - "//window_manager/dm/src/display_manager.cpp", - "//window_manager/dm/src/display_manager_adapter.cpp", - "//window_manager/dm/src/screen.cpp", - "//window_manager/dm/src/screen_group.cpp", - "//window_manager/dm/src/screen_manager.cpp", - "//window_manager/dm/src/zidl/display_manager_agent_stub.cpp", - "//window_manager/dmserver/src/display_manager_proxy.cpp", + "$window_manager_path/dm/src/display.cpp", + "$window_manager_path/dm/src/display_manager.cpp", + "$window_manager_path/dm/src/display_manager_adapter.cpp", + "$window_manager_path/dm/src/screen.cpp", + "$window_manager_path/dm/src/screen_group.cpp", + "$window_manager_path/dm/src/screen_manager.cpp", + "$window_manager_path/dm/src/zidl/display_manager_agent_stub.cpp", + "$window_manager_path/dmserver/src/display_manager_proxy.cpp", ] configs = [ ":libdm_private_config", - "//window_manager/resources/config/build:coverage_flags", + "$window_manager_path/resources/config/build:coverage_flags", "//build/gn/configs/system_libs:hilog_config", "//build/gn/configs/system_libs:c_utils_config", "//build/gn/configs/system_libs:ipc_core_config", @@ -60,8 +57,7 @@ ft_shared_library("libdm") { public_configs = [ ":libdm_public_config" ] deps = [ - "//display_server/frameworks/surface/ft_build:surface", - "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", - "//window_manager/utils/ft_build:libwmutil", + "$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/dm/src/display.cpp b/window_manager/dm/src/display.cpp index ed32119..0f50b80 100644 --- a/window_manager/dm/src/display.cpp +++ b/window_manager/dm/src/display.cpp @@ -19,7 +19,6 @@ #include #include "class_var_definition.h" -#include "display_info.h" #include "display_manager_adapter.h" #include "singleton_container.h" #include "window_manager_hilog.h" diff --git a/window_manager/ft_adapter/ability_context.h b/window_manager/ft_adapter/ability_context.h new file mode 100644 index 0000000..fa6fb86 --- /dev/null +++ b/window_manager/ft_adapter/ability_context.h @@ -0,0 +1,24 @@ +/* + * 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_NATIVE_ABILITY_CONTEXT_H +#define OHOS_ABILITY_RUNTIME_NATIVE_ABILITY_CONTEXT_H + +namespace OHOS { +namespace AppExecFwk { +class AbilityContext; +} // namespace AppExecFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_NATIVE_ABILITY_CONTEXT_H diff --git a/window_manager/ft_adapter/ability_info.h b/window_manager/ft_adapter/ability_info.h index e414168..7b5e023 100644 --- a/window_manager/ft_adapter/ability_info.h +++ b/window_manager/ft_adapter/ability_info.h @@ -16,6 +16,9 @@ #ifndef ABILITY_INFO_H #define ABILITY_INFO_H +#include +#include + namespace OHOS { namespace AppExecFwk { enum class SupportWindowMode { @@ -39,6 +42,18 @@ enum class DisplayOrientation { AUTO_ROTATION_PORTRAIT_RESTRICTED, LOCKED, }; + +struct AbilityInfo : public Parcelable { + std::string name; + DisplayOrientation orientation = DisplayOrientation::UNSPECIFIED; + std::vector windowModes; + double maxWindowRatio = 0; + double minWindowRatio = 0; + uint32_t maxWindowWidth = 0; + uint32_t minWindowWidth = 0; + uint32_t maxWindowHeight = 0; + uint32_t minWindowHeight = 0; +}; } // namespace AppExecFwk } // namespace OHOS #endif // ABILITY_INFO_H diff --git a/window_manager/ft_adapter/ability_manager_client.h b/window_manager/ft_adapter/ability_manager_client.h new file mode 100644 index 0000000..e914606 --- /dev/null +++ b/window_manager/ft_adapter/ability_manager_client.h @@ -0,0 +1,83 @@ +/* + * 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_ABILITY_MANAGER_CLIENT_H +#define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_CLIENT_H + +namespace OHOS { +namespace AbilityRuntime { +class AbilityContext { +public: + sptr GetToken() + { + return nullptr; + } + int32_t TerminateSelf() + { + return 0; + } + int32_t CloseAbility() + { + return 0; + } + std::shared_ptr GetAbilityInfo() const + { + return nullptr; + } +}; + +class Context { +public: + template + static std::shared_ptr ConvertTo(const std::shared_ptr& context) + { + return nullptr; + } + std::string GetBundleName() const + { + return ""; + } + sptr GetToken() + { + return nullptr; + } +}; +} // namespace AbilityRuntime +} // namespace OHOS + +namespace OHOS { +namespace AAFwk { +class AbilityManagerClient { +public: + static std::shared_ptr GetInstance() + { + return nullptr; + } + int32_t DoAbilityForeground(const sptr &token, uint32_t flag) + { + return 0; + } + int32_t DoAbilityBackground(const sptr &token, uint32_t flag) + { + return 0; + } + int32_t MinimizeAbility(const sptr &token, bool fromUser = false) + { + return 0; + } +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_CLIENT_H diff --git a/window_manager/ft_adapter/rs_iwindow_animation_controller.h b/window_manager/ft_adapter/rs_iwindow_animation_controller.h new file mode 100644 index 0000000..2c3ecc6 --- /dev/null +++ b/window_manager/ft_adapter/rs_iwindow_animation_controller.h @@ -0,0 +1,30 @@ +/* + * 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 WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H +#define WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H + +#include + +namespace OHOS { +namespace Rosen { +class RSIWindowAnimationController : public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.rosen.RSIWindowAnimationController"); +}; +} // namespace Rosen +} // namespace OHOS + +#endif // WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H diff --git a/window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h b/window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h new file mode 100644 index 0000000..42c3972 --- /dev/null +++ b/window_manager/ft_adapter/rs_iwindow_animation_finished_callback.h @@ -0,0 +1,32 @@ +/* + * 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 WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H +#define WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H + +#include + +namespace OHOS { +namespace Rosen { +struct RSWindowAnimationTarget; + +class RSIWindowAnimationFinishedCallback : public IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.rosen.RSIWindowAnimationFinishedCallback"); +}; +} // namespace Rosen +} // namespace OHOS + +#endif // WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_FINISHED_CALLBACK_H diff --git a/window_manager/ft_adapter/transaction/rs_interfaces.h b/window_manager/ft_adapter/transaction/rs_interfaces.h index 7329a10..04eec55 100644 --- a/window_manager/ft_adapter/transaction/rs_interfaces.h +++ b/window_manager/ft_adapter/transaction/rs_interfaces.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 @@ -18,8 +18,19 @@ #include +class RSSurfaceNode; + +namespace OHOS { +namespace AppExecFwk { +class EventHandler; +} +} + namespace OHOS { namespace Rosen { +class VSyncReceiver; +class SurfaceCaptureCallback; + class RSInterfaces { public: static RSInterfaces &GetInstance() @@ -38,6 +49,18 @@ public: return; } + std::shared_ptr CreateVSyncReceiver( + const std::string& name, const std::shared_ptr &looper = nullptr) + { + 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 {}; diff --git a/window_manager/ft_adapter/ui_content.h b/window_manager/ft_adapter/ui_content.h new file mode 100644 index 0000000..0ed7382 --- /dev/null +++ b/window_manager/ft_adapter/ui_content.h @@ -0,0 +1,110 @@ +/* + * 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 FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_UI_CONTENT_H +#define FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_UI_CONTENT_H + +#include +#include +#include + +#include + +class NativeValue; + +namespace OHOS::AAFwk { +class Want; +} + +namespace OHOS::AppExecFwk { +class Ability; +class Configuration; +} + +namespace OHOS::AppExecFwk { +class Context; +} + +namespace OHOS::MMI { +class PointerEvent; +class KeyEvent; +} + +namespace OHOS::Media { + class PixelMap; +} + +namespace OHOS::Ace { +class ViewportConfig { +public: + void SetSize(int32_t width, int32_t height) {} + void SetPosition(int32_t x, int32_t y) {} + void SetDensity(float density) {} +}; + +class UIContent { +public: + static std::unique_ptr Create(OHOS::AbilityRuntime::Context* context, NativeEngine* runtime) + { + return nullptr; + } + static std::unique_ptr Create(OHOS::AppExecFwk::Ability* ability) + { + return nullptr; + } + static void ShowDumpHelp(std::vector& info) {} + + void Initialize(OHOS::Rosen::Window* window, const std::string& url, NativeValue* storage) {} + void Foreground() {} + void Background() {} + void Focus() {} + void UnFocus() {} + void Destroy() {} + void OnNewWant(const OHOS::AAFwk::Want& want) {} + void DumpInfo(const std::vector& params, std::vector& info) {} + void Restore(OHOS::Rosen::Window* window, const std::string& contentInfo, NativeValue* storage) {} + void SetBackgroundColor(uint32_t color) {} + void SetAppWindowTitle(const std::string& title) {} + void SetAppWindowIcon(const std::shared_ptr& pixelMap) {} + void SetNextFrameLayoutCallback(std::function&& callback) {} + void HideWindowTitleButton(bool hideSplit, bool hideMaximize, bool hideMinimize) {} + void NotifyMemoryLevel(int32_t level) {} + void UpdateWindowMode(OHOS::Rosen::WindowMode mode) {} + void UpdateConfiguration(const std::shared_ptr& config) {} + void UpdateViewportConfig(const ViewportConfig& config, OHOS::Rosen::WindowSizeChangeReason reason) {} + std::string GetContentInfo() + { + return ""; + } + uint32_t GetBackgroundColor() + { + return 0; + } + bool ProcessPointerEvent(const std::shared_ptr& pointerEvent) + { + return true; + } + bool ProcessKeyEvent(const std::shared_ptr& keyEvent) + { + return true; + } + bool ProcessBackPressed() + { + return true; + } +}; +} // namespace OHOS::Ace + +#endif // FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_UI_CONTENT_H diff --git a/window_manager/interfaces/innerkits/dm/display.h b/window_manager/interfaces/innerkits/dm/display.h index 1c0a8f3..115e012 100644 --- a/window_manager/interfaces/innerkits/dm/display.h +++ b/window_manager/interfaces/innerkits/dm/display.h @@ -17,17 +17,48 @@ #define FOUNDATION_DM_DISPLAY_H #include +#include + #include "dm_common.h" +#include "class_var_definition.h" #include "noncopyable.h" namespace OHOS::Rosen { -class DisplayInfo; class CutoutInfo; enum class DisplayType : uint32_t { DEFAULT = 0, }; +class DisplayInfo : public Parcelable { +friend class AbstractDisplay; +public: + DisplayInfo() = default; + ~DisplayInfo() = default; + WM_DISALLOW_COPY_AND_MOVE(DisplayInfo); + + virtual bool Marshalling(Parcel& parcel) const override; + static DisplayInfo *Unmarshalling(Parcel& parcel); + + DEFINE_VAR_DEFAULT_FUNC_GET(std::string, Name, name, ""); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayId, DisplayId, id, DISPLAY_ID_INVALID); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayType, DisplayType, type, DisplayType::DEFAULT); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Width, width, 0); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Height, height, 0); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(uint32_t, RefreshRate, refreshRate, 0); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenId, screenId, SCREEN_ID_INVALID); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenGroupId, screenGroupId, SCREEN_ID_INVALID); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, VirtualPixelRatio, virtualPixelRatio, 1.0f); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, XDpi, xDpi, 0.0f); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, YDpi, yDpi, 0.0f); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(Rotation, Rotation, rotation, Rotation::ROTATION_0); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(Orientation, Orientation, orientation, Orientation::UNSPECIFIED); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetX, offsetX, 0); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetY, offsetY, 0); + DEFINE_VAR_DEFAULT_FUNC_GET(DisplayState, DisplayState, displayState, DisplayState::UNKNOWN); + DEFINE_VAR_DEFAULT_FUNC_GET_SET(bool, WaterfallDisplayCompressionStatus, waterfallDisplayCompressionStatus, false); +}; + class Display : public RefBase { friend class DisplayManager; public: diff --git a/window_manager/utils/ft_build/BUILD.gn b/window_manager/utils/ft_build/BUILD.gn index 99231ac..f1db17c 100644 --- a/window_manager/utils/ft_build/BUILD.gn +++ b/window_manager/utils/ft_build/BUILD.gn @@ -17,45 +17,42 @@ config("libwmutil_private_config") { cflags = [ "-Wno-c++11-narrowing" ] include_dirs = [ - "../include", - "//window_manager/interfaces/innerkits/dm", - "//window_manager/interfaces/innerkits/wm", - "//window_manager/ft_adapter", - "//display_server/interfaces/inner_api/surface", - "//display_server/interfaces/inner_api/common", - "//display_server/utils/buffer_handle/export", - "//display_server/rosen/modules/render_service_base/include", + "$window_manager_path/utils/include", + "$window_manager_path/interfaces/innerkits/dm", + "$window_manager_path/interfaces/innerkits/wm", + "$window_manager_path/ft_adapter", + "$display_server_path/utils/buffer_handle/export", ] } config("libwmutil_public_config") { - include_dirs = [ "//window_manager/utils/include" ] + include_dirs = [ "$window_manager_path/utils/include" ] } ft_shared_library("libwmutil") { sources = [ - "../src/agent_death_recipient.cpp", - "../src/cutout_info.cpp", - "../src/display_info.cpp", - "../src/perform_reporter.cpp", - "../src/permission.cpp", - "../src/screen_group_info.cpp", - "../src/screen_info.cpp", - "../src/screenshot_info.cpp", - "../src/singleton_container.cpp", - "../src/string_util.cpp", - "../src/surface_reader.cpp", - "../src/surface_reader_handler_impl.cpp", - "../src/sys_cap_util.cpp", - "../src/window_property.cpp", - "../src/window_transition_info.cpp", - "../src/wm_math.cpp", - "../src/wm_occlusion_region.cpp", + "$window_manager_path/utils/src/agent_death_recipient.cpp", + "$window_manager_path/utils/src/cutout_info.cpp", + "$window_manager_path/utils/src/display_info.cpp", + "$window_manager_path/utils/src/perform_reporter.cpp", + "$window_manager_path/utils/src/permission.cpp", + "$window_manager_path/utils/src/screen_group_info.cpp", + "$window_manager_path/utils/src/screen_info.cpp", + "$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_reader.cpp", + "$window_manager_path/utils/src/surface_reader_handler_impl.cpp", + "$window_manager_path/utils/src/sys_cap_util.cpp", + "$window_manager_path/utils/src/window_property.cpp", + "$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", ] configs = [ ":libwmutil_private_config", - "//window_manager/resources/config/build:coverage_flags", + "$window_manager_path/resources/config/build:coverage_flags", "//build/gn/configs/system_libs:hilog_config", "//build/gn/configs/system_libs:c_utils_config", "//build/gn/configs/system_libs:ipc_core_config", @@ -68,7 +65,7 @@ ft_shared_library("libwmutil") { public_configs = [ ":libwmutil_public_config" ] deps = [ - "//display_server/frameworks/surface/ft_build:surface", - "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + "$display_server_path/frameworks/surface/ft_build:surface", + "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", ] } diff --git a/window_manager/utils/include/display_info.h b/window_manager/utils/include/display_info.h index 291d9c8..3f6c276 100644 --- a/window_manager/utils/include/display_info.h +++ b/window_manager/utils/include/display_info.h @@ -16,42 +16,6 @@ #ifndef FOUNDATION_DMSERVER_DISPLAY_INFO_H #define FOUNDATION_DMSERVER_DISPLAY_INFO_H -#include -#include - -#include "class_var_definition.h" #include "display.h" -#include "dm_common.h" -#include "noncopyable.h" - -namespace OHOS::Rosen { -class DisplayInfo : public Parcelable { -friend class AbstractDisplay; -public: - DisplayInfo() = default; - ~DisplayInfo() = default; - WM_DISALLOW_COPY_AND_MOVE(DisplayInfo); - - virtual bool Marshalling(Parcel& parcel) const override; - static DisplayInfo *Unmarshalling(Parcel& parcel); - DEFINE_VAR_DEFAULT_FUNC_GET(std::string, Name, name, ""); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayId, DisplayId, id, DISPLAY_ID_INVALID); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayType, DisplayType, type, DisplayType::DEFAULT); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Width, width, 0); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Height, height, 0); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(uint32_t, RefreshRate, refreshRate, 0); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenId, screenId, SCREEN_ID_INVALID); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenGroupId, screenGroupId, SCREEN_ID_INVALID); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, VirtualPixelRatio, virtualPixelRatio, 1.0f); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, XDpi, xDpi, 0.0f); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, YDpi, yDpi, 0.0f); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(Rotation, Rotation, rotation, Rotation::ROTATION_0); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(Orientation, Orientation, orientation, Orientation::UNSPECIFIED); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetX, offsetX, 0); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetY, offsetY, 0); - DEFINE_VAR_DEFAULT_FUNC_GET(DisplayState, DisplayState, displayState, DisplayState::UNKNOWN); - DEFINE_VAR_DEFAULT_FUNC_GET_SET(bool, WaterfallDisplayCompressionStatus, waterfallDisplayCompressionStatus, false); -}; -} // namespace OHOS::Rosen #endif // FOUNDATION_DMSERVER_DISPLAY_INFO_H \ No newline at end of file diff --git a/window_manager/wm/ft_build/BUILD.gn b/window_manager/wm/ft_build/BUILD.gn new file mode 100644 index 0000000..f33b208 --- /dev/null +++ b/window_manager/wm/ft_build/BUILD.gn @@ -0,0 +1,79 @@ +# 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("libwm_private_config") { + visibility = [ ":*" ] + + cflags = [ "-Wno-c++11-narrowing" ] + + include_dirs = [ + "$window_manager_path/wm/include", + "$window_manager_path/wmserver/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", + ] +} + +config("libwm_public_config") { + include_dirs = [ + "$window_manager_path/interfaces/innerkits/wm", + "$window_manager_path/utils/include", + ] +} + +ft_shared_library("libwm") { + sources = [ + "$window_manager_path/wm/src/color_parser.cpp", + "$window_manager_path/wm/src/input_transfer_station.cpp", + "$window_manager_path/wm/src/vsync_station.cpp", + "$window_manager_path/wm/src/window.cpp", + "$window_manager_path/wm/src/window_accessibility_controller.cpp", + "$window_manager_path/wm/src/window_adapter.cpp", + "$window_manager_path/wm/src/window_agent.cpp", + "$window_manager_path/wm/src/window_frame_trace_impl.cpp", + "$window_manager_path/wm/src/window_impl.cpp", + "$window_manager_path/wm/src/window_input_channel.cpp", + "$window_manager_path/wm/src/window_manager.cpp", + "$window_manager_path/wm/src/window_manager_agent.cpp", + "$window_manager_path/wm/src/window_option.cpp", + "$window_manager_path/wm/src/zidl/window_manager_agent_stub.cpp", + "$window_manager_path/wm/src/zidl/window_stub.cpp", + "$window_manager_path/wmserver/src/zidl/window_manager_proxy.cpp", + ] + + configs = [ + ":libwm_private_config", + "$window_manager_path/resources/config/build:coverage_flags", + "//build/gn/configs/system_libs:hilog_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:image_config", + "//build/gn/configs/system_libs:samgr_config", + "//build/gn/configs/system_libs:eventhandler_config", + "//build/gn/configs/system_libs:mmi_config", + "//build/gn/configs/system_libs:skia_config", + ] + + public_configs = [ ":libwm_public_config" ] + + deps = [ + "$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", + "$window_manager_path/utils/ft_build:libwmutil", + ] +} diff --git a/window_manager/wm/src/window_impl.cpp b/window_manager/wm/src/window_impl.cpp index 416b1f3..ead4293 100755 --- a/window_manager/wm/src/window_impl.cpp +++ b/window_manager/wm/src/window_impl.cpp @@ -15,7 +15,6 @@ #include "window_impl.h" - #include #include #include diff --git a/window_manager/wm/src/window_manager_agent.cpp b/window_manager/wm/src/window_manager_agent.cpp index 2595a11..0b93509 100644 --- a/window_manager/wm/src/window_manager_agent.cpp +++ b/window_manager/wm/src/window_manager_agent.cpp @@ -14,7 +14,7 @@ */ #include "window_manager_agent.h" -#include "foundation/window/window_manager/interfaces/innerkits/wm/window_manager.h" +#include "window_manager.h" #include "singleton_container.h" #include "wm_common.h" -- Gitee