1 /* 2 * Copyright (c) 2023 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, Hardware 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 <iostream> 17 18 #include "transaction/rs_interfaces.h" 19 20 using namespace OHOS::Rosen; 21 using namespace std; 22 main()23int main() 24 { 25 RSInterfaces& rsInterfaces = RSInterfaces::GetInstance(); 26 auto screenId = rsInterfaces.GetDefaultScreenId(); 27 if (screenId == INVALID_SCREEN_ID) { 28 cout << "Default Screen Id is INVALID_SCREEN_ID !" << std::endl; 29 } 30 std::cout << "ScreenID : " << screenId << endl; 31 32 auto screenData = rsInterfaces.GetScreenData(screenId); 33 34 auto screenCapability = screenData.GetCapability(); 35 36 cout << "Name : " << screenCapability.GetName() << endl; 37 cout << "PhiWidth : " << screenCapability.GetPhyWidth() << endl; 38 cout << "PhiHeight : " << screenCapability.GetPhyHeight() << endl; 39 40 auto modeInfo = screenData.GetActivityModeInfo(); 41 cout << "RefreshRate : " << modeInfo.GetScreenRefreshRate() << endl; 42 cout << "ScreenHeight : " << modeInfo.GetScreenHeight() << endl; 43 cout << "ScreenWidth : " << modeInfo.GetScreenWidth() << endl; 44 }