diff --git a/BUILD.gn b/BUILD.gn index 24ec5287d5028b43f4551ec75add1749bcadff21..477d3a68cf6b24c53cd324d6ac832269fe017094 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -90,6 +90,7 @@ group("multimodalinput_mmi_frameworks") { group("multimodalinput_mmi_service") { deps = [ + "service:libmmi-knuckle", "service:libmmi-server", "tools/inject_event:uinput", "util/screen_capture:libmmi-screen_capture", diff --git a/bundle.json b/bundle.json index 5701997a16cff1c426194e622a859df9bcd450df..fd7ce81dd4c8abdeeae6df0446cee687e2343015 100644 --- a/bundle.json +++ b/bundle.json @@ -102,7 +102,8 @@ "ipc", "sensor", "idl_tool", - "runtime_core" + "runtime_core", + "skia" ], "third_party": [ "libuv", diff --git a/service/BUILD.gn b/service/BUILD.gn index f75f7ebd6a597fd9af7b8852b5e1d32b67d52035..e7203516685ac54042693e6ae2eccca8682371b3 100644 --- a/service/BUILD.gn +++ b/service/BUILD.gn @@ -163,6 +163,82 @@ ohos_rust_unittest("rust_mmi_test") { part_name = "input" } +config("libmmi_knuckle_config") { + if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64") && + enhanced_opt) { + cflags = [] + if (input_feature_enable_pgo && input_feature_product != "default") { + cflags += [ + "-fprofile-use=" + + rebase_path("${input_feature_pgo_path}/libmmi-server.profdata", + root_build_dir), + "-Wno-error=backend-plugin", + "-Wno-profile-instr-out-of-date", + "-Wno-profile-instr-unprofiled", + "-Oz", + ] + } + if (input_feature_product == "pc" && target_cpu == "arm64") { + cflags += [ + "-moutline-atomics", + "-Oz", + ] + } + } +} + +ohos_shared_library("libmmi-knuckle") { + include_dirs = [ + "${mmi_path}/interfaces/native/innerkits/proxy/include", + "${mmi_service_path}/window_manager/include", + ] + + if (input_ext_feature_anco) { + include_dirs += [ "${mmi_path}/common/anco/comm/include" ] + } + + sources = [ + "window_manager/src/knuckle_divergent_point.cpp", + "window_manager/src/knuckle_drawing_manager.cpp", + "window_manager/src/knuckle_dynamic_drawing_manager.cpp", + "window_manager/src/knuckle_glow_point.cpp", + "window_manager/src/knuckle_glow_trace_system.cpp", + ] + + configs = [ + "${mmi_path}:coverage_flags", + ":libmmi_knuckle_config", + ] + + if (defined(use_rosen_drawing) && use_rosen_drawing) { + defines += [ "USE_ROSEN_DRAWING" ] + } + + deps = [ "${mmi_path}/util:libmmi-util" ] + + external_deps = [ + "data_share:datashare_consumer", + "graphic_2d:librender_service_base", + "graphic_2d:librender_service_client", + "libinput:libinput-third-mmi", + "skia:skia_canvaskit", + ] + + if (input_feature_pointer_drawing) { + external_deps += [ "window_manager:libwm_lite" ] + } + + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + part_name = "input" + subsystem_name = "multimodalinput" +} + ohos_shared_library("libmmi-server") { sources = libmmi_service_sources branch_protector_ret = "pac_ret" @@ -300,9 +376,7 @@ ohos_shared_library("libmmi-server") { deps += [ "${mmi_path}/common/anco/comm:mmi_anco_channel_proxy" ] if (input_ext_feature_keyboard_ext_flag) { - include_dirs += [ - "${mmi_ext_path}/keyboard_ext_flag/inc", - ] + include_dirs += [ "${mmi_ext_path}/keyboard_ext_flag/inc" ] deps += [ ":keyboard_ext_flag.json" ] } @@ -382,16 +456,12 @@ ohos_shared_library("libmmi-server") { ] if (input_feature_product != "watch") { - sources += [ - "infrared_emitter/src/infrared_emitter_controller.cpp", - "window_manager/src/knuckle_divergent_point.cpp", - "window_manager/src/knuckle_drawing_manager.cpp", - "window_manager/src/knuckle_dynamic_drawing_manager.cpp", - "window_manager/src/knuckle_glow_point.cpp", - "window_manager/src/knuckle_glow_trace_system.cpp", - ] + sources += [ "infrared_emitter/src/infrared_emitter_controller.cpp" ] - deps += [ "${mmi_path}/etc/mouse_icon:input_mouse_icon" ] + deps += [ + ":libmmi-knuckle", + "${mmi_path}/etc/mouse_icon:input_mouse_icon", + ] if (input_feature_mouse || input_feature_touchscreen) { if (input_feature_mouse) { @@ -1051,10 +1121,10 @@ ohos_unittest("PointerDrawingManagerTest") { "init:libbegetutil", "ipc:ipc_core", "libinput:libinput-third-mmi", + "preferences:native_preferences", "window_manager:libdm_lite", "window_manager:libwm", "window_manager:libwsutils", - "preferences:native_preferences", ] } @@ -1108,10 +1178,10 @@ ohos_unittest("PointerDrawingManagerExTest") { "init:libbegetutil", "ipc:ipc_core", "libinput:libinput-third-mmi", + "preferences:native_preferences", "window_manager:libdm_lite", "window_manager:libwm", "window_manager:libwsutils", - "preferences:native_preferences", ] } @@ -3004,8 +3074,8 @@ ohos_unittest("JoystickTest") { "hilog:libhilog_base", "hisysevent:libhisysevent", "init:libbegetutil", - "libinput:libinput-third-mmi", "ipc:ipc_core", + "libinput:libinput-third-mmi", ] } diff --git a/service/key_command/include/setting_datashare.h b/service/key_command/include/setting_datashare.h index dce8aeee58f319038611c667ab9527ed557a220c..a99cd71c4732523fb303663c99e44368b857490c 100644 --- a/service/key_command/include/setting_datashare.h +++ b/service/key_command/include/setting_datashare.h @@ -44,6 +44,8 @@ public: ErrCode UnregisterObserver(const sptr& observer, const std::string &strUri = std::string()); bool CheckIfSettingsDataReady(); + using SetStrValFunc = std::function; + bool RegisterGetStrValCb(const std::string &dataKey, SetStrValFunc setValCallback); private: static std::shared_ptr instance_; static std::mutex mutex_; diff --git a/service/key_command/src/setting_datashare.cpp b/service/key_command/src/setting_datashare.cpp index 2d4f6bcf3efbcb92e3bdc24757dbe21a9a7cafdc..09416146803e8864d515c21090b344bcda9d8dae 100644 --- a/service/key_command/src/setting_datashare.cpp +++ b/service/key_command/src/setting_datashare.cpp @@ -328,5 +328,31 @@ bool SettingDataShare::CheckIfSettingsDataReady() MMI_HILOGE("data_share unknown"); return true; } + +bool SettingDataShare::RegisterGetStrValCb(const std::string &dataKey, SetStrValFunc setValCallback) +{ + SettingObserver::UpdateFunc updateFunc = [setValCallback] (const std::string &key) { + std::string val; + auto ret = SettingDataShare::GetInstance(MULTIMODAL_INPUT_SERVICE_ID).GetStringValue(key, val); + if (ret != RET_OK) { + MMI_HILOGE("Get value from setting date fail"); + return; + } + if (!setValCallback) { + MMI_HILOGE("the callback function of setting value is null"); + return; + } + setValCallback(val); + }; + sptr statusObserver = SettingDataShare::GetInstance(MULTIMODAL_INPUT_SERVICE_ID).CreateObserver(dataKey, updateFunc); + ErrCode ret = SettingDataShare::GetInstance(MULTIMODAL_INPUT_SERVICE_ID).RegisterObserver(statusObserver); + if (ret != ERR_OK) { + MMI_HILOGE("Register setting observer failed, ret=%{public}d", ret); + statusObserver = nullptr; + return false; + } + return true; +} + } } // namespace OHOS \ No newline at end of file diff --git a/service/module_loader/src/mmi_service.cpp b/service/module_loader/src/mmi_service.cpp index 5bb3e91e71cef32ba049b5214a92a7ecda89ba4c..235689004f2c45d5ace78b4f6c53171c4a27ea89 100644 --- a/service/module_loader/src/mmi_service.cpp +++ b/service/module_loader/src/mmi_service.cpp @@ -4885,7 +4885,27 @@ int32_t MMIService::SetMultiWindowScreenIdInner(uint64_t screenId, uint64_t disp #endif // OHOS_BUILD_ENABLE_TOUCH_DRAWING #ifndef OHOS_BUILD_ENABLE_WATCH if (knuckleDrawMgr_ == nullptr) { - knuckleDrawMgr_ = std::make_shared(); + auto winMgrCalcDrawCoordinateFunc = [](const DisplayInfo &displayInfo, + PointerEvent::PointerItem pointerItem) -> std::pair + { + return WIN_MGR->CalcDrawCoordinate(displayInfo, pointerItem); + }; + + auto registerTimerMgrAddTimerFunc = [](int32_t intervalMs, int32_t repeatCount, + std::function callback) -> int32_t + { + return TimerMgr->AddTimer(intervalMs, repeatCount, callback); + }; + + auto registerObserverFunc = [](const std::string &dataKey, + SettingDataShare::SetStrValFunc setValCallback) -> bool + { + return SettingDataShare::GetInstance(MULTIMODAL_INPUT_SERVICE_ID) + .RegisterGetStrValCb(dataKey, setValCallback); + }; + + knuckleDrawMgr_ = std::make_shared(winMgrCalcDrawCoordinateFunc, + registerTimerMgrAddTimerFunc, registerObserverFunc); } CHKPR(knuckleDrawMgr_, RET_ERR); knuckleDrawMgr_->SetMultiWindowScreenId(screenId, displayNodeScreenId); diff --git a/service/window_manager/include/i_knuckle_drawing.h b/service/window_manager/include/i_knuckle_drawing.h new file mode 100644 index 0000000000000000000000000000000000000000..9fd4fa84ad8f0ee9b12d195fc160a28cb73b92f4 --- /dev/null +++ b/service/window_manager/include/i_knuckle_drawing.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 I_KNUCKLE_DRAWING_H +#define I_KNUCKLE_DRAWING_H + +#include "window_info.h" + +namespace OHOS { +namespace MMI { +class IKunckleDrawing { +public: + IKunckleDrawing() = default; + virtual ~IKunckleDrawing() = default; + void Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) = 0; + + // void KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1) = 0; + // void UpdateDisplayInfo(const DisplayInfo& displayInfo) = 0; + // void DynamicKnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1) = 0; + // void DynamicUpdateDisplayInfo(const DisplayInfo& displayInfo) = 0; +}; +} // namespace MMI +} // namespace OHOS +#endif // I_KNUCKLE_DRAWING_HANDLER_H diff --git a/service/window_manager/include/knuckle_component.h b/service/window_manager/include/knuckle_component.h new file mode 100644 index 0000000000000000000000000000000000000000..34211ce18af3a598fcbe175bc9bfee2ac81369b4 --- /dev/null +++ b/service/window_manager/include/knuckle_component.h @@ -0,0 +1,40 @@ +/* + * 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 KNUCKLE_COMPONENTS_H +#define KNUCKLE_COMPONENTS_H + +#include "window_info.h" + +namespace OHOS { +namespace MMI { +class KnuckleComponent { +public: + DECLARE_DELAYED_SINGLETON(KnuckleComponent); + + // 普通绘制 + void KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1); + void UpdateDisplayInfo(const DisplayInfo& displayInfo); + + // 增强绘制 + void DynamicKnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1); + void DynamicUpdateDisplayInfo(const DisplayInfo& displayInfo); + +private: + +}; +} // namespace MMI +} // namespace OHOS +#endif // KNUCKLE_COMPONENTS_H \ No newline at end of file diff --git a/service/window_manager/include/knuckle_drawing.h b/service/window_manager/include/knuckle_drawing.h new file mode 100644 index 0000000000000000000000000000000000000000..ff1ad8ead973ffbf45db1d7786c7d1110390a085 --- /dev/null +++ b/service/window_manager/include/knuckle_drawing.h @@ -0,0 +1,41 @@ +/* + * 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 KNUCKLE_DRAWING_H +#define KNUCKLE_DRAWING_H + +#include "i_knuckle_drawing.h" + +namespace OHOS { +namespace MMI { +class KunckleDrawing final : public IKunckleDrawing { +public: + KunckleDrawing() = default; + ~KunckleDrawing() = default override; + + void Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) override; + // void KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1) override; + // void UpdateDisplayInfo(const DisplayInfo& displayInfo) override; + // void DynamicKnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1) override; + // void DynamicUpdateDisplayInfo(const DisplayInfo& displayInfo) override; + +private: + std::shared_ptr knuckleDrawMgr_; + std::shared_ptr knuckleDynamicDrawMgr_; +}; +} // namespace MMI +} // namespace OHOS + +#endif // KNUCKLE_DRAWING_H diff --git a/service/window_manager/include/knuckle_drawing_manager.h b/service/window_manager/include/knuckle_drawing_manager.h index 64ca9b06ea706560d458a5f5a62d544bfafd4ccb..1e1884d18404375a8b623f926905a1ca256acf48 100644 --- a/service/window_manager/include/knuckle_drawing_manager.h +++ b/service/window_manager/include/knuckle_drawing_manager.h @@ -39,6 +39,7 @@ class KnuckleDrawingManager { public: void KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1); void UpdateDisplayInfo(const DisplayInfo& displayInfo); + KnuckleDrawingManager(); ~KnuckleDrawingManager() = default; void RotationCanvasNode(std::shared_ptr canvasNode, const DisplayInfo& displayInfo); diff --git a/service/window_manager/src/input_windows_manager.cpp b/service/window_manager/src/input_windows_manager.cpp index aa1b5b1aa3959c8fe1138ec0da2ee38db47861c2..8bb9fb72b3c8619611a5971bb93fae8af06d0abc 100644 --- a/service/window_manager/src/input_windows_manager.cpp +++ b/service/window_manager/src/input_windows_manager.cpp @@ -5566,7 +5566,27 @@ void InputWindowsManager::DrawTouchGraphic(std::shared_ptr pointer CHKPV(pointerEvent); #ifdef OHOS_BUILD_ENABLE_GESTURESENSE_WRAPPER if (knuckleDrawMgr_ == nullptr) { - knuckleDrawMgr_ = std::make_shared(); + + auto winMgrCalcDrawCoordinateFunc = [](const DisplayInfo &displayInfo, + PointerEvent::PointerItem pointerItem) -> std::pair + { + return WIN_MGR->CalcDrawCoordinate(displayInfo, pointerItem); + }; + + auto registerTimerMgrAddTimerFunc = [](int32_t intervalMs, int32_t repeatCount, + std::function callback) -> int32_t + { + return TimerMgr->AddTimer(intervalMs, repeatCount, callback); + }; + + auto registerObserverFunc = [](const std::string &dataKey, + SettingDataShare::SetStrValFunc setValCallback) -> bool + { + return SettingDataShare::GetInstance(MULTIMODAL_INPUT_SERVICE_ID) + .RegisterGetStrValCb(dataKey, setValCallback); + }; + knuckleDrawMgr_ = std::make_shared(winMgrCalcDrawCoordinateFunc, + registerTimerMgrAddTimerFunc, registerObserverFunc); } #ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC if (knuckleDynamicDrawingManager_ == nullptr) { diff --git a/service/window_manager/src/knuckle_conponent.cpp b/service/window_manager/src/knuckle_conponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec5aa4a82463d5a9dce1327fc5f1996afafe1c87 --- /dev/null +++ b/service/window_manager/src/knuckle_conponent.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2025 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 "knuckle_component.h" + +namespace { +constexpr std::string KNUCKLE_LIB_PATH = "libmmi-knuckle.z.so"; +} + +namespace OHOS { +namespace MMI { +void KnuckleComponent::Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) +{ + IKunckleDrawing *knuckleDrawing = Load(); + if (knuckleDrawing == nullptr) { + return; + } + + knuckleDrawing->Draw(displayInfo, touchEvent); +} + +// void KnuckleComponent::KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId) +// { +// IKunckleDrawing *knuckleDrawing = LoadImpl(); +// if (knuckleDrawing == nullptr) { +// return; +// } +// knuckleDrawing->KnuckleDrawHandler(touchEvent, displayId); +// } + +// void KnuckleComponent::UpdateDisplayInfo(const DisplayInfo& displayInfo) +// { +// IKunckleDrawing *knuckleDrawing = LoadImpl(); +// if (knuckleDrawing == nullptr) { +// return; +// } +// knuckleDrawing->UpdateDisplayInfo(displayInfo); +// } + +// void KnuckleComponent::DynamicKnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId) +// { +// IKunckleDrawing *knuckleDrawing = LoadImpl(); +// if (knuckleDrawing == nullptr) { +// return; +// } +// knuckleDrawing->DynamicKnuckleDrawHandler(touchEvent, displayId); +// } + +// void KnuckleComponent::DynamicUpdateDisplayInfo(const DisplayInfo& displayInfo) +// { +// IKunckleDrawing *knuckleDrawing = LoadImpl(); +// if (knuckleDrawing == nullptr) { +// return; +// } +// knuckleDrawing->DynamicUpdateDisplayInfo(displayInfo); +// } + +KnuckleComponent::KnuckleComponent() + : handle_(nullptr) + , impl_(nullptr) +{ +} + +KnuckleComponent::~KnuckleComponent() +{ + Unload(); +} + +IKunckleDrawing *KnuckleComponent::Load() +{ + // impl_加锁,粒度太大,改成原子变量 + if (impl_ != nullptr) { + return impl_; + } + + std::unique_lock lock(implMutex_); + if (handle_ == nullptr) { + char realPath[PATH_MAX] = { 0 }; + if (realpath(KNUCKLE_LIB_PATH, realPath) == nullptr) { + FI_HILOGE("Path is error, path is %{public}s", KNUCKLE_LIB_PATH.c_str()); + return; + } + handle_ = ::dlopen(realPath, RTLD_NOW); + if (handle_ == nullptr) { + FI_HILOGE("%{public}s dlopen fail", KNUCKLE_LIB_PATH.c_str()); + return; + } + } + + CreateKnuckleFunc create = reinterpret_cast<>(::dlsym(handle_, "GetKunckleDrawing")); + if (create == nullptr) { + Unload(); + return nullptr; + } + + impl_ = create(); + return impl_; +} + +void KnuckleComponent::Unload() +{ + std::unique_lock lock(implMutex_); + if (handle_ != nullptr && impl_ != nullptr) { + DestroyKnuckleFunc destroy = reinterpret_cast<>(::dlsym(handle_, "DestroyKunckleDrawing")); + if (destroy != nullptr) { + destory(impl_); + } + impl_ = nullptr; + } + + if (handle_ != nullptr) { + ::dlclose(handle_); + handle_ = nullptr; + } +} +} // namespace MMI +} // namespace OHOS \ No newline at end of file diff --git a/service/window_manager/src/knuckle_drawing.cpp b/service/window_manager/src/knuckle_drawing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ccc3ff47424c8f062abc0a4fa096af8043a3ba13 --- /dev/null +++ b/service/window_manager/src/knuckle_drawing.cpp @@ -0,0 +1,75 @@ +/* + * 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 "knuckle_drawing.h" + +namespace OHOS { +namespace MMI { + +std::shared_ptr GetInstance() +{ + static std::shared_ptr instance = std::make_shared(); + return instance; +} + +KunckleDrawing::KunckleDrawing() + : knuckleDrawMgr_(std::make_shared()) + , knuckleDynamicDrawMgr_(std::make_shared(knuckleDrawMgr_)) +{ +} + +void KunckleDrawing::Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) +{ + knuckleDrawMgr_->UpdateDisplayInfo(displayInfo); + knuckleDrawMgr_->KnuckleDrawHandler(pointerEvent, displayInfo.uniqueId); +#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC + knuckleDynamicDrawingManager_->UpdateDisplayInfo(displayInfo); + knuckleDynamicDrawingManager_->KnuckleDynamicDrawHandler(pointerEvent, displayInfo.uniqueId); +#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC +} + +// void KunckleDrawing::KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId) +// { +// knuckleDrawMgr_->KnuckleDrawHandler(touchEvent, displayId); +// } + +// void KunckleDrawing::UpdateDisplayInfo(const DisplayInfo& displayInfo) +// { +// knuckleDrawMgr_->UpdateDisplayInfo(displayInfo); +// } + +// void KunckleDrawing::DynamicKnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId) +// { +// knuckleDynamicDrawMgr_->DynamicKnuckleDrawHandler(touchEvent, displayId); +// } + +// void KunckleDrawing::DynamicUpdateDisplayInfo(const DisplayInfo& displayInfo) +// { +// knuckleDynamicDrawMgr_->DynamicUpdateDisplayInfo(displayInfo); +// } + +extern "C" KunckleDrawing *GetKunckleDrawing() +{ + return new KunckleDrawing(); +} + +extern "C" void DestroyKunckleDrawing(KunckleDrawing *inst) +{ + if (inst != nullptr) { + delete inst; + } +} +} // namespace MMI +} // namespace OHOS \ No newline at end of file diff --git a/service/window_manager/src/knuckle_drawing_manager.cpp b/service/window_manager/src/knuckle_drawing_manager.cpp index 5db1b17be1d217c0ef8ab642e1e5982f25f5179d..4d72f6adae1a900a52d7690c7e03a28d9d75bee7 100644 --- a/service/window_manager/src/knuckle_drawing_manager.cpp +++ b/service/window_manager/src/knuckle_drawing_manager.cpp @@ -15,6 +15,7 @@ #include "knuckle_drawing_manager.h" +#include "mmi_log.h" #ifdef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC #include "animation/rs_particle_params.h" #endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC @@ -23,12 +24,6 @@ #else #include "ui/rs_canvas_drawing_node.h" #endif // USE_ROSEN_DRAWING -#include "imultimodal_input_connect.h" -#include "input_windows_manager.h" -#include "setting_datashare.h" -#ifdef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC -#include "timer_manager.h" -#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC #include "touch_drawing_manager.h" #include @@ -57,7 +52,7 @@ constexpr int32_t ROTATION_ANGLE_0 { 0 }; constexpr int32_t ROTATION_ANGLE_90 { 90 }; constexpr int32_t ROTATION_ANGLE_180 { 180 }; constexpr int32_t ROTATION_ANGLE_270 { 270 }; -constexpr uint64_t FOLD_SCREEN_MAIN_ID { 5 }; +[[ maybe_unused ]] constexpr uint64_t FOLD_SCREEN_MAIN_ID { 5 }; constexpr std::string_view SCREEN_READING { "accessibility_screenreader_enabled" }; constexpr std::string_view SCREEN_READ_ENABLE { "1" }; constexpr int32_t POINTER_NUMBER_TO_DRAW { 10 }; diff --git a/service/window_manager/src/knuckle_dynamic_drawing_manager.cpp b/service/window_manager/src/knuckle_dynamic_drawing_manager.cpp index 920a95da91305b2c8322e910d2c0387bc1e628cf..ab4ce31fbf7822623c1d3da1f62124dd502d9c70 100644 --- a/service/window_manager/src/knuckle_dynamic_drawing_manager.cpp +++ b/service/window_manager/src/knuckle_dynamic_drawing_manager.cpp @@ -16,7 +16,6 @@ #include "knuckle_dynamic_drawing_manager.h" #include "image_source.h" -#include "input_windows_manager.h" #include "mmi_log.h" #ifndef USE_ROSEN_DRAWING #include "pipeline/rs_recording_canvas.h"