From c4338216b93ea34cb449cf835824dbbe3264d986 Mon Sep 17 00:00:00 2001 From: xiahaiqin Date: Sun, 16 Jan 2022 13:38:51 +0800 Subject: [PATCH] split libwmutil Signed-off-by: xiahaiqin Change-Id: I34d1d61aa6d3ef91d21db1ed941e5e4e3708b1a9 --- bundle.json | 2 +- dm/BUILD.gn | 4 +- interfaces/kits/napi/screenshot/BUILD.gn | 4 +- interfaces/kits/napi/window_runtime/BUILD.gn | 4 +- snapshot/BUILD.gn | 2 +- utils/BUILD.gn | 53 +++++++++++++++++++ {dmserver => utils}/include/display_info.h | 0 .../include/virtual_display_info.h | 0 {wm => utils}/include/window_property.h | 0 {dmserver => utils}/src/display_info.cpp | 0 .../src/virtual_display_info.cpp | 0 {wm => utils}/src/window_property.cpp | 0 wm/BUILD.gn | 42 +-------------- wm/test/systemtest/BUILD.gn | 10 ++-- wm/test/unittest/BUILD.gn | 2 +- wmserver/BUILD.gn | 2 +- wmtest/BUILD.gn | 2 +- 17 files changed, 71 insertions(+), 56 deletions(-) create mode 100644 utils/BUILD.gn rename {dmserver => utils}/include/display_info.h (100%) rename {dmserver => utils}/include/virtual_display_info.h (100%) rename {wm => utils}/include/window_property.h (100%) rename {dmserver => utils}/src/display_info.cpp (100%) rename {dmserver => utils}/src/virtual_display_info.cpp (100%) rename {wm => utils}/src/window_property.cpp (100%) diff --git a/bundle.json b/bundle.json index cb6d339b..09f6e181 100644 --- a/bundle.json +++ b/bundle.json @@ -23,7 +23,7 @@ "//foundation/windowmanager/dm:libdm", "//foundation/windowmanager/wm:libwm", "//foundation/windowmanager/wmserver:libwms", - "//foundation/windowmanager/wm:libwmutil", + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/snapshot:snapshot_display", "//foundation/windowmanager/interfaces/kits/napi:windowstage", "//foundation/windowmanager/interfaces/kits/napi:napi_packages" diff --git a/dm/BUILD.gn b/dm/BUILD.gn index f2b7f189..80e36103 100644 --- a/dm/BUILD.gn +++ b/dm/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 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 @@ -56,7 +56,7 @@ ohos_shared_library("libdm") { "//foundation/graphic/standard/rosen/modules/render_service_base:librender_service_base", "//foundation/graphic/standard/rosen/modules/render_service_client:librender_service_client", "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", - "//foundation/windowmanager/wm:libwmutil", + "//foundation/windowmanager/utils:libwmutil", "//utils/native/base:utils", ] diff --git a/interfaces/kits/napi/screenshot/BUILD.gn b/interfaces/kits/napi/screenshot/BUILD.gn index 9b7cbb68..4fddfe6d 100644 --- a/interfaces/kits/napi/screenshot/BUILD.gn +++ b/interfaces/kits/napi/screenshot/BUILD.gn @@ -20,14 +20,14 @@ ohos_shared_library("screenshot") { deps = [ "../common:wm_napi_common", "//foundation/multimedia/image_standard/interfaces/innerkits:image", - "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", + "//foundation/windowmanager/utils:libwmutil", ] external_deps = [ "aafwk_standard:runtime", "hiviewdfx_hilog_native:libhilog", "napi:ace_napi", + "window_manager:libwm", ] relative_install_dir = "module" diff --git a/interfaces/kits/napi/window_runtime/BUILD.gn b/interfaces/kits/napi/window_runtime/BUILD.gn index 4c58fe36..f6e2c980 100644 --- a/interfaces/kits/napi/window_runtime/BUILD.gn +++ b/interfaces/kits/napi/window_runtime/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//ark/ts2abc/ts2panda/ts2abc_config.gni") import("//build/ohos.gni") @@ -37,8 +37,8 @@ ohos_shared_library("windowmanager_napi") { configs = [ ":window_manager_napi_config" ] deps = [ + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", "//foundation/windowmanager/wmserver:libwms", ] diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index c3b895ae..947e0af3 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -30,8 +30,8 @@ ohos_executable("snapshot_display") { deps = [ "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", # PixelMap "//foundation/windowmanager/dm:libdm", + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", "//third_party/libpng:libpng", # png ] diff --git a/utils/BUILD.gn b/utils/BUILD.gn new file mode 100644 index 00000000..72275096 --- /dev/null +++ b/utils/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright (c) 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. + +import("//build/ohos.gni") + +config("libwmutil_private_config") { + include_dirs = [ + "include", + "//foundation/windowmanager/dmserver/include", + "../interfaces/innerkits/dm", + "../interfaces/innerkits/wm", + ] +} + +config("libwmutil_public_config") { + include_dirs = [ "//foundation/windowmanager/utils/include" ] +} + +## Build libwmutil.so +ohos_shared_library("libwmutil") { + sources = [ + "src/display_info.cpp", + "src/singleton_container.cpp", + "src/virtual_display_info.cpp", + "src/window_property.cpp", + "src/wm_trace.cpp", + ] + + configs = [ ":libwmutil_private_config" ] + + public_configs = [ ":libwmutil_public_config" ] + + deps = [ "//utils/native/base:utils" ] + + external_deps = [ + "bytrace_standard:bytrace_core", + "hilog_native:libhilog", + "ipc:ipc_core", + ] + + part_name = "window_manager" + subsystem_name = "window" +} diff --git a/dmserver/include/display_info.h b/utils/include/display_info.h similarity index 100% rename from dmserver/include/display_info.h rename to utils/include/display_info.h diff --git a/dmserver/include/virtual_display_info.h b/utils/include/virtual_display_info.h similarity index 100% rename from dmserver/include/virtual_display_info.h rename to utils/include/virtual_display_info.h diff --git a/wm/include/window_property.h b/utils/include/window_property.h similarity index 100% rename from wm/include/window_property.h rename to utils/include/window_property.h diff --git a/dmserver/src/display_info.cpp b/utils/src/display_info.cpp similarity index 100% rename from dmserver/src/display_info.cpp rename to utils/src/display_info.cpp diff --git a/dmserver/src/virtual_display_info.cpp b/utils/src/virtual_display_info.cpp similarity index 100% rename from dmserver/src/virtual_display_info.cpp rename to utils/src/virtual_display_info.cpp diff --git a/wm/src/window_property.cpp b/utils/src/window_property.cpp similarity index 100% rename from wm/src/window_property.cpp rename to utils/src/window_property.cpp diff --git a/wm/BUILD.gn b/wm/BUILD.gn index 4eea5f9f..b0cb7b4e 100644 --- a/wm/BUILD.gn +++ b/wm/BUILD.gn @@ -68,45 +68,6 @@ config("libwm_public_config_test") { include_dirs = [ "//foundation/windowmanager/interfaces/innerkits" ] } -config("libwmutil_private_config") { - include_dirs = [ - "include", - "//foundation/windowmanager/dmserver/include", - "../interfaces/innerkits/dm", - "../interfaces/innerkits/wm", - ] -} - -config("libwmutil_public_config") { - include_dirs = [ "//foundation/windowmanager/utils/include" ] -} - -## Build libwmutil.so -ohos_shared_library("libwmutil") { - sources = [ - "../dmserver/src/display_info.cpp", - "../dmserver/src/virtual_display_info.cpp", - "../utils/src/singleton_container.cpp", - "../utils/src/wm_trace.cpp", - "src/window_property.cpp", - ] - - configs = [ ":libwmutil_private_config" ] - - public_configs = [ ":libwmutil_public_config" ] - - deps = [ "//utils/native/base:utils" ] - - external_deps = [ - "bytrace_standard:bytrace_core", - "hilog_native:libhilog", - "ipc:ipc_core", - ] - - part_name = "window_manager" - subsystem_name = "window" -} - ## Build libwm.so ohos_shared_library("libwm") { sources = [ @@ -145,7 +106,7 @@ ohos_shared_library("libwm") { "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", - "//foundation/windowmanager/wm:libwmutil", + "//foundation/windowmanager/utils:libwmutil", "//utils/native/base:utils", # weston adapter @@ -181,6 +142,7 @@ ohos_shared_library("libwm") { "aafwk_standard:ability_context_native", "bytrace_standard:bytrace_core", "ipc:ipc_core", + "window_manager:libdm", ] part_name = "window_manager" diff --git a/wm/test/systemtest/BUILD.gn b/wm/test/systemtest/BUILD.gn index 84b5b617..5b1f16a7 100644 --- a/wm/test/systemtest/BUILD.gn +++ b/wm/test/systemtest/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//build/test.gni") @@ -35,7 +35,7 @@ ohos_systemtest("wm_window_layout_test") { deps = [ ":wm_systemtest_common" ] } -## SystemTest wm_window_layout_test }}} +## SystemTest wm_window_layout_test }}} ## SystemTest wm_window_multi_ability_test {{{ ohos_systemtest("wm_window_multi_ability_test") { @@ -46,7 +46,7 @@ ohos_systemtest("wm_window_multi_ability_test") { deps = [ ":wm_systemtest_common" ] } -## SystemTest wm_window_multi_ability_test }}} +## SystemTest wm_window_multi_ability_test }}} ## SystemTest wm_window_subwindow_test {{{ ohos_systemtest("wm_window_subwindow_test") { @@ -57,7 +57,7 @@ ohos_systemtest("wm_window_subwindow_test") { deps = [ ":wm_systemtest_common" ] } -## SystemTest wm_window_subwindow_test }}} +## SystemTest wm_window_subwindow_test }}} ## SystemTest wm_window_immersive_test {{{ ohos_systemtest("wm_window_immersive_test") { @@ -116,8 +116,8 @@ ohos_static_library("wm_systemtest_common") { public_deps = [ "//foundation/ace/ace_engine/interfaces/innerkits/ace:ace_uicontent", "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client", + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", "//foundation/windowmanager/wmserver:libwms", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", diff --git a/wm/test/unittest/BUILD.gn b/wm/test/unittest/BUILD.gn index 144000bc..60e4f70f 100644 --- a/wm/test/unittest/BUILD.gn +++ b/wm/test/unittest/BUILD.gn @@ -137,8 +137,8 @@ ohos_static_library("wm_unittest_common") { public_deps = [ "//foundation/ace/ace_engine/interfaces/innerkits/ace:ace_uicontent", "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client", + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", "//foundation/windowmanager/wmserver:libwms", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", diff --git a/wmserver/BUILD.gn b/wmserver/BUILD.gn index 39fcb188..ace5e1b5 100644 --- a/wmserver/BUILD.gn +++ b/wmserver/BUILD.gn @@ -86,7 +86,7 @@ ohos_shared_library("libwms") { # IMS "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client", - "//foundation/windowmanager/wm:libwmutil", + "//foundation/windowmanager/utils:libwmutil", ] external_deps = [ diff --git a/wmtest/BUILD.gn b/wmtest/BUILD.gn index 2d2d77b6..5332058f 100644 --- a/wmtest/BUILD.gn +++ b/wmtest/BUILD.gn @@ -60,8 +60,8 @@ ohos_executable("rosenwmtest") { "//foundation/graphic/standard:libwmclient", "//foundation/graphic/standard:libwmservice", "//foundation/windowmanager/adapter:libwmadaptertest", + "//foundation/windowmanager/utils:libwmutil", "//foundation/windowmanager/wm:libwm", - "//foundation/windowmanager/wm:libwmutil", "//foundation/windowmanager/wmserver:libwms", "//third_party/zlib:libz",