From bdd724f4a3462d0db8b5ab4f105fcc3b80c3cbda Mon Sep 17 00:00:00 2001 From: Mupceet Date: Tue, 12 Jul 2022 18:42:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=BA=E6=97=A0=E9=9A=9C=E7=A2=8D?= =?UTF-8?q?=E5=AD=90=E7=B3=BB=E7=BB=9F=E6=8F=90=E4=BE=9B=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=E8=AE=BE=E5=AE=9A=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mupceet --- bundle.json | 1 + .../wm/window_accessibility_controller.h | 36 ++++++++++++++++++ wm/BUILD.gn | 1 + wm/src/window_accessibility_controller.cpp | 37 +++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 interfaces/innerkits/wm/window_accessibility_controller.h create mode 100644 wm/src/window_accessibility_controller.cpp diff --git a/bundle.json b/bundle.json index 19d159c7..56fdb36e 100644 --- a/bundle.json +++ b/bundle.json @@ -78,6 +78,7 @@ "header": { "header_files": [ "window.h", + "window_accessibility_controller.h", "window_manager.h", "window_option.h", "window_scene.h", diff --git a/interfaces/innerkits/wm/window_accessibility_controller.h b/interfaces/innerkits/wm/window_accessibility_controller.h new file mode 100644 index 00000000..1fba985f --- /dev/null +++ b/interfaces/innerkits/wm/window_accessibility_controller.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#ifndef OHOS_ROSEN_WINDOW_ACCESSIBILITY_CONTROLLER_H +#define OHOS_ROSEN_WINDOW_ACCESSIBILITY_CONTROLLER_H + +#include +#include "wm_single_instance.h" + +namespace OHOS { +namespace Rosen { +class WindowAccessibilityController { +WM_DECLARE_SINGLE_INSTANCE_BASE(WindowAccessibilityController); +public: + void SetAnchorAndScale(int32_t x, int32_t y, float scale); + void SetAnchorOffset(int32_t deltaX, int32_t deltaY); + void OffWindowZoom(); +private: + WindowAccessibilityController(); + ~WindowAccessibilityController() = default; +}; +} // namespace Rosen +} // namespace OHOS +#endif // OHOS_ROSEN_WINDOW_ACCESSIBILITY_CONTROLLER_H \ No newline at end of file diff --git a/wm/BUILD.gn b/wm/BUILD.gn index 6f47948e..8a5d426e 100644 --- a/wm/BUILD.gn +++ b/wm/BUILD.gn @@ -44,6 +44,7 @@ ohos_shared_library("libwm") { "src/static_call.cpp", "src/vsync_station.cpp", "src/window.cpp", + "src/window_accessibility_controller.cpp", "src/window_adapter.cpp", "src/window_agent.cpp", "src/window_impl.cpp", diff --git a/wm/src/window_accessibility_controller.cpp b/wm/src/window_accessibility_controller.cpp new file mode 100644 index 00000000..8bf3334c --- /dev/null +++ b/wm/src/window_accessibility_controller.cpp @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#include "window_accessibility_controller.h" + +namespace OHOS { +namespace Rosen { +WM_IMPLEMENT_SINGLE_INSTANCE(WindowAccessibilityController) +WindowAccessibilityController::WindowAccessibilityController() +{ +} + +void WindowAccessibilityController::SetAnchorAndScale(int32_t x, int32_t y, float scale) +{ +} + +void WindowAccessibilityController::SetAnchorOffset(int32_t deltaX, int32_t deltaY) +{ +} + +void WindowAccessibilityController::OffWindowZoom() +{ +} +} // namespace Rosen +} // namespace OHOS \ No newline at end of file From 187576cc30b2702f4649f62822767ac8ded5d94e Mon Sep 17 00:00:00 2001 From: Mupceet Date: Wed, 20 Jul 2022 16:43:47 +0800 Subject: [PATCH 2/2] fix review problem Signed-off-by: Mupceet --- interfaces/innerkits/wm/window_accessibility_controller.h | 6 ++---- wm/src/window_accessibility_controller.cpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/interfaces/innerkits/wm/window_accessibility_controller.h b/interfaces/innerkits/wm/window_accessibility_controller.h index 1fba985f..a0b77715 100644 --- a/interfaces/innerkits/wm/window_accessibility_controller.h +++ b/interfaces/innerkits/wm/window_accessibility_controller.h @@ -19,8 +19,7 @@ #include #include "wm_single_instance.h" -namespace OHOS { -namespace Rosen { +namespace OHOS::Rosen { class WindowAccessibilityController { WM_DECLARE_SINGLE_INSTANCE_BASE(WindowAccessibilityController); public: @@ -31,6 +30,5 @@ private: WindowAccessibilityController(); ~WindowAccessibilityController() = default; }; -} // namespace Rosen -} // namespace OHOS +} // namespace OHOS::Rosen #endif // OHOS_ROSEN_WINDOW_ACCESSIBILITY_CONTROLLER_H \ No newline at end of file diff --git a/wm/src/window_accessibility_controller.cpp b/wm/src/window_accessibility_controller.cpp index 8bf3334c..8e5ca3c4 100644 --- a/wm/src/window_accessibility_controller.cpp +++ b/wm/src/window_accessibility_controller.cpp @@ -15,8 +15,7 @@ #include "window_accessibility_controller.h" -namespace OHOS { -namespace Rosen { +namespace OHOS::Rosen { WM_IMPLEMENT_SINGLE_INSTANCE(WindowAccessibilityController) WindowAccessibilityController::WindowAccessibilityController() { @@ -33,5 +32,4 @@ void WindowAccessibilityController::SetAnchorOffset(int32_t deltaX, int32_t delt void WindowAccessibilityController::OffWindowZoom() { } -} // namespace Rosen -} // namespace OHOS \ No newline at end of file +} // namespace OHOS::Rosen \ No newline at end of file