• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2024-2025 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 #include "core/common/display_info_utils.h"
17 
18 #include "core/common/display_info.h"
19 #include "window_display.h"
20 
21 namespace OHOS::Previewer {
22     class PreviewerDisplay;
23 }
24 namespace OHOS::Ace {
GetDisplayInfo(int32_t displayId)25 RefPtr<DisplayInfo> DisplayInfoUtils::GetDisplayInfo(int32_t displayId)
26 {
27     return AceType::MakeRefPtr<DisplayInfo>();
28 }
29 
InitIsFoldable()30 void DisplayInfoUtils::InitIsFoldable() {}
31 
GetIsFoldable()32 bool DisplayInfoUtils::GetIsFoldable()
33 {
34     hasInitIsFoldable_ = true;
35     return OHOS::Previewer::PreviewerDisplay::GetInstance().IsFoldable();
36 }
37 
GetCurrentFoldStatus()38 FoldStatus DisplayInfoUtils::GetCurrentFoldStatus()
39 {
40     auto dmFoldStatus = OHOS::Previewer::PreviewerDisplay::GetInstance().GetFoldStatus();
41     CHECK_NULL_RETURN(displayInfo_, FoldStatus::UNKNOWN);
42     displayInfo_->SetFoldStatus(static_cast<FoldStatus>(static_cast<uint32_t>(dmFoldStatus)));
43     return displayInfo_->GetFoldStatus();
44 }
45 
GetCurrentFoldCreaseRegion()46 std::vector<Rect> DisplayInfoUtils::GetCurrentFoldCreaseRegion()
47 {
48     hasInitFoldCreaseRegion_ = true;
49     return {};
50 }
51 
GetDisplayAvailableRect(int32_t displayId) const52 Rect DisplayInfoUtils::GetDisplayAvailableRect(int32_t displayId) const
53 {
54     return Rect();
55 }
56 } // namespace OHOS::Ace::DisplayInfoUtils
57