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 OHOS_DISPLAY_UTILS_H 17 #define OHOS_DISPLAY_UTILS_H 18 19 #include <cstdint> 20 #include <memory> 21 #include <string> 22 23 #define FFI_EXPORT __attribute__((visibility("default"))) 24 25 extern "C" { 26 typedef struct { 27 int32_t code; 28 int64_t len; 29 void *data; 30 } RetStruct; 31 32 typedef struct { 33 int32_t left; 34 int32_t top; 35 uint32_t width; 36 uint32_t height; 37 } CRect; 38 39 typedef struct { 40 CRect left; 41 CRect top; 42 CRect right; 43 CRect bottom; 44 } CWaterfallDisplayAreaRects; 45 46 typedef struct { 47 CRect *boundingRects; 48 int64_t number; 49 CWaterfallDisplayAreaRects waterfallDisplayAreaRects; 50 } CCutoutInfo; 51 52 typedef struct { 53 uint32_t displayId; 54 int64_t number; 55 CRect *creaseRects; 56 } CFoldCreaseRegion; 57 } 58 59 namespace OHOS { 60 namespace Rosen { 61 enum class DisplayRetCode : int32_t { 62 RET_OK = 0, 63 RET_ERR = -1, 64 RET_FIND_EXISTS = 0xf0000000, 65 }; 66 } 67 } 68 69 #endif // OHOS_DISPLAY_UTILS_H 70