1 /* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HARDWARE_CURSOR_POINTER_MANAGER_H 17 #define HARDWARE_CURSOR_POINTER_MANAGER_H 18 19 #include <mutex> 20 21 #include "singleton.h" 22 #include "v1_2/include/idisplay_composer_interface.h" 23 24 namespace OHOS { 25 namespace MMI { 26 class HardwareCursorPointerManager { 27 public: 28 HardwareCursorPointerManager() = default; 29 ~HardwareCursorPointerManager() = default; 30 void SetTargetDevice(uint32_t devId); 31 bool IsSupported(); 32 int32_t SetPosition(int32_t x, int32_t y); 33 int32_t EnableStats(bool enable); 34 int32_t GetCursorStats(uint32_t &frameCount, uint32_t &vsyncCount); 35 private: 36 bool isEnableState_ { false }; 37 bool isEnable_ { false }; 38 uint32_t devId_ { 0 }; 39 sptr<OHOS::HDI::Display::Composer::V1_2::IDisplayComposerInterface> powerInterface_ = nullptr; 40 }; 41 } // namespace MMI 42 } // namespace OHOS 43 #endif // HARDWARE_CURSOR_POINTER_MANAGER_H 44