1 /* 2 * Copyright (c) 2021-2022 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 FOUNDATION_DMSERVER_DISPLAY_INFO_H 17 #define FOUNDATION_DMSERVER_DISPLAY_INFO_H 18 19 #include <cstdint> 20 #include <parcel.h> 21 22 #include "class_var_definition.h" 23 #include "display.h" 24 #include "dm_common.h" 25 #include "noncopyable.h" 26 27 namespace OHOS::Rosen { 28 class DisplayInfo : public Parcelable { 29 friend class AbstractDisplay; 30 public: 31 DisplayInfo() = default; 32 ~DisplayInfo() = default; 33 WM_DISALLOW_COPY_AND_MOVE(DisplayInfo); 34 35 virtual bool Marshalling(Parcel& parcel) const override; 36 static DisplayInfo *Unmarshalling(Parcel& parcel); 37 38 DEFINE_VAR_DEFAULT_FUNC_GET(std::string, Name, name, ""); 39 DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayId, DisplayId, id, DISPLAY_ID_INVALID); 40 DEFINE_VAR_DEFAULT_FUNC_GET_SET(DisplayType, DisplayType, type, DisplayType::DEFAULT); 41 DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Width, width, 0); 42 DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, Height, height, 0); 43 DEFINE_VAR_DEFAULT_FUNC_GET_SET(uint32_t, RefreshRate, refreshRate, 0); 44 DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenId, screenId, SCREEN_ID_INVALID); 45 DEFINE_VAR_DEFAULT_FUNC_GET_SET(ScreenId, ScreenGroupId, screenGroupId, SCREEN_ID_INVALID); 46 DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, VirtualPixelRatio, virtualPixelRatio, 1.0f); 47 DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, XDpi, xDpi, 0.0f); 48 DEFINE_VAR_DEFAULT_FUNC_GET_SET(float, YDpi, yDpi, 0.0f); 49 DEFINE_VAR_DEFAULT_FUNC_GET_SET(Rotation, Rotation, rotation, Rotation::ROTATION_0); 50 DEFINE_VAR_DEFAULT_FUNC_GET_SET(Orientation, Orientation, orientation, Orientation::UNSPECIFIED); 51 DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetX, offsetX, 0); 52 DEFINE_VAR_DEFAULT_FUNC_GET_SET(int32_t, OffsetY, offsetY, 0); 53 DEFINE_VAR_DEFAULT_FUNC_GET(DisplayState, DisplayState, displayState, DisplayState::UNKNOWN); 54 DEFINE_VAR_DEFAULT_FUNC_GET_SET(bool, WaterfallDisplayCompressionStatus, waterfallDisplayCompressionStatus, false); 55 }; 56 } // namespace OHOS::Rosen 57 #endif // FOUNDATION_DMSERVER_DISPLAY_INFO_H