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 /** 17 * @addtogroup OH_DisplayManager 18 * @{ 19 * 20 * @brief Defines the data structures for the C APIs of the display module. 21 * 22 * @syscap SystemCapability.WindowManager.WindowManager.Core 23 * @since 12 24 * @version 1.0 25 */ 26 27 /** 28 * @file oh_display_manager.h 29 * 30 * @brief Defines the data structures for the C APIs of the display module. 31 * 32 * @kit ArkUI 33 * @library libnative_display_manager.so 34 * @syscap SystemCapability.WindowManager.WindowManager.Core 35 * @since 12 36 * @version 1.0 37 */ 38 39 #ifndef OH_NATIVE_DISPLAY_MANAGER_H 40 #define OH_NATIVE_DISPLAY_MANAGER_H 41 42 43 #include "oh_display_info.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 /** 50 * @brief Obtain the default display Id. 51 * 52 * @param displayId Indicates the pointer to an <b>uint64_t</b> object. 53 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 54 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 55 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 56 * @since 12 57 */ 58 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(uint64_t *displayId); 59 60 /** 61 * @brief Obtain the default display width. 62 * 63 * @param displayWidth Indicates the pointer to an <b>int32_t</b> object. 64 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 65 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 66 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 67 * @since 12 68 */ 69 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(int32_t *displayWidth); 70 71 /** 72 * @brief Obtain the default display height. 73 * 74 * @param displayHeight Indicates the pointer to an <b>int32_t</b> object. 75 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 76 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 77 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 78 * @since 12 79 */ 80 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(int32_t *displayHeight); 81 82 /** 83 * @brief Obtain the default display rotation. 84 * 85 * @param displayRotation Indicates the pointer to an <b>NativeDisplayManager_Rotation</b> object. 86 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 87 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 88 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 89 * @since 12 90 */ 91 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation( 92 NativeDisplayManager_Rotation *displayRotation); 93 94 /** 95 * @brief Obtain the default display orientation. 96 * 97 * @param displayOrientation Indicates the pointer to an <b>NativeDisplayManager_Orientation</b> object. 98 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 99 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 100 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 101 * @since 12 102 */ 103 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientation( 104 NativeDisplayManager_Orientation *displayOrientation); 105 106 /** 107 * @brief Obtain the default display virtualPixels. 108 * 109 * @param virtualPixels Indicates the pointer to an <b>float</b> object. 110 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 111 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 112 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 113 * @since 12 114 */ 115 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio(float *virtualPixels); 116 117 /** 118 * @brief Obtain the default display refreshRate. 119 * 120 * @param refreshRate Indicates the pointer to an <b>uint32_t</b> object. 121 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 122 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 123 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 124 * @since 12 125 */ 126 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(uint32_t *refreshRate); 127 128 /** 129 * @brief Obtain the default display densityDpi. 130 * 131 * @param densityDpi Indicates the pointer to an <b>int32_t</b> object. 132 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 133 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 134 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 135 * @since 12 136 */ 137 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityDpi(int32_t *densityDpi); 138 139 /** 140 * @brief Obtain the default display densityPixels. 141 * 142 * @param densityPixels Indicates the pointer to an <b>float</b> object. 143 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 144 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 145 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 146 * @since 12 147 */ 148 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityPixels(float *densityPixels); 149 150 /** 151 * @brief Obtain the default display scaledDensity. 152 * 153 * @param scaledDensity Indicates the pointer to an <b>float</b> object. 154 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 155 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 156 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 157 * @since 12 158 */ 159 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDensity(float *scaledDensity); 160 161 /** 162 * @brief Obtain the default display xDpi. 163 * 164 * @param xDpi Indicates the pointer to an <b>float</b> object. 165 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 166 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 167 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 168 * @since 12 169 */ 170 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi(float *xDpi); 171 172 /** 173 * @brief Obtain the default display yDpi. 174 * 175 * @param yDpi Indicates the pointer to an <b>float</b> object. 176 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 177 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 178 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 179 * @since 12 180 */ 181 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi(float *yDpi); 182 183 /** 184 * @brief Create the cutout info of the device. 185 * 186 * @param cutoutInfo Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object. 187 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 188 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 189 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 190 * @since 12 191 */ 192 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo( 193 NativeDisplayManager_CutoutInfo **cutoutInfo); 194 195 /** 196 * @brief Destroy an <b>NativeDisplayManager_CutoutInfo</b> object and reclaims the memory occupied by the object. 197 * 198 * @param cutoutInfo Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object. 199 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 200 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 201 * @since 12 202 */ 203 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo( 204 NativeDisplayManager_CutoutInfo *cutoutInfo); 205 206 /** 207 * @brief Check whether the device is foldable. 208 * 209 * @return { bool } true means the device is foldable. 210 * @since 12 211 */ 212 bool OH_NativeDisplayManager_IsFoldable(); 213 214 /** 215 * @brief Get the display mode of the foldable device. 216 * 217 * @param displayMode Indicates the pointer to an <b>NativeDisplayManager_FoldDisplayMode</b> object. 218 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 219 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 220 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 221 * @since 12 222 */ 223 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode( 224 NativeDisplayManager_FoldDisplayMode *displayMode); 225 226 /** 227 * @brief the callback function type when display change. 228 * 229 * @param displayId change display id. 230 * @since 12 231 */ 232 typedef void (*OH_NativeDisplayManager_DisplayChangeCallback)(uint64_t displayId); 233 234 /** 235 * @brief Register the callback for display change listener. 236 * 237 * @param displayChangeCallback display change callback. 238 * @param listenerIndex Indicates the pointer to an <b>uint32_t</b> object. used in unregister call. 239 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 240 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 241 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 242 * @since 12 243 */ 244 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeListener( 245 OH_NativeDisplayManager_DisplayChangeCallback displayChangeCallback, uint32_t *listenerIndex); 246 247 /** 248 * @brief Unregister the callback for display changes listener. 249 * 250 * @param listenerIndex display changed listener index. 251 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 252 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 253 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 254 * @since 12 255 */ 256 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeListener(uint32_t listenerIndex); 257 258 /** 259 * @brief the callback function type when display fold change. 260 * 261 * @param displayMode current fold display mode. 262 * @since 12 263 */ 264 typedef void (*OH_NativeDisplayManager_FoldDisplayModeChangeCallback)( 265 NativeDisplayManager_FoldDisplayMode displayMode); 266 267 /** 268 * @brief Register the callback for display mode change listener. 269 * 270 * @param displayModeChangeCallback display mode change callback. 271 * @param listenerIndex Indicates the pointer to an <b>uint32_t</b> object. used in unregister call. 272 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 273 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 274 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 275 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 276 * @since 12 277 */ 278 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener( 279 OH_NativeDisplayManager_FoldDisplayModeChangeCallback displayModeChangeCallback, uint32_t *listenerIndex); 280 281 /** 282 * @brief Unregister the callback for display mode change listener. 283 * 284 * @param listenerIndex display mode change listener index. 285 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 286 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 287 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 288 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 289 * @since 12 290 */ 291 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(uint32_t listenerIndex); 292 293 /** 294 * @brief Create all displays. 295 * 296 * @param allDisplays Output parameter for all displays information. 297 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. 298 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 299 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 300 * @since 14 301 */ 302 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAllDisplays( 303 NativeDisplayManager_DisplaysInfo **allDisplays); 304 305 /** 306 * @brief Destroy all displays. 307 * 308 * @param allDisplays all displays to be free. 309 * @since 14 310 */ 311 void OH_NativeDisplayManager_DestroyAllDisplays(NativeDisplayManager_DisplaysInfo *allDisplays); 312 313 /** 314 * @brief Create display information by display id. 315 * 316 * @param displayId The display id. 317 * @param displayInfo The pointer to the display information. 318 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. 319 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 320 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 321 * @since 14 322 */ 323 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDisplayById(uint32_t displayId, 324 NativeDisplayManager_DisplayInfo **displayInfo); 325 326 /** 327 * @brief Destroy the display information. 328 * 329 * @param displayInfo the target display to be free. 330 * @since 14 331 */ 332 void OH_NativeDisplayManager_DestroyDisplay(NativeDisplayManager_DisplayInfo *displayInfo); 333 334 /** 335 * @brief Create a primary display. 336 * 337 * @param displayInfo The information of the created display. 338 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. 339 * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. 340 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 341 * @since 14 342 */ 343 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreatePrimaryDisplay( 344 NativeDisplayManager_DisplayInfo **displayInfo); 345 346 /** 347 * @brief the callback function type when available area change. 348 * 349 * @param displayId The changed display id. 350 * @since 20 351 */ 352 typedef void (*OH_NativeDisplayManager_AvailableAreaChangeCallback)(uint64_t displayId); 353 354 /** 355 * @brief Register the callback for available area change listener. 356 * 357 * @param availableAreaChangeCallback Available area change callback. 358 * @param listenerIndex Indicates the pointer to an <b>uint32_t</b> object. used in unregister call. 359 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 360 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 361 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 362 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 363 * @since 20 364 */ 365 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterAvailableAreaChangeListener( 366 OH_NativeDisplayManager_AvailableAreaChangeCallback availableAreaChangeCallback, uint32_t *listenerIndex); 367 368 /** 369 * @brief Unregister the callback for available area changes listener. 370 * 371 * @param listenerIndex The display changed listener index. 372 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 373 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 374 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 375 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 376 * @since 20 377 */ 378 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterAvailableAreaChangeListener(uint32_t listenerIndex); 379 380 /** 381 * @brief Create the available area. 382 * 383 * @param displayId The display id. 384 * @param availableArea Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object. 385 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 386 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 387 * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. 388 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 389 * @since 20 390 */ 391 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAvailableArea(uint64_t displayId, NativeDisplayManager_Rect **availableArea); 392 393 /** 394 * @brief Destroy an <b>NativeDisplayManager_Rect</b> object and reclaims the memory occupied by the object. 395 * 396 * @param availableArea Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object. 397 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 398 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 399 * @since 20 400 */ 401 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyAvailableArea(NativeDisplayManager_Rect *availableArea); 402 403 /** 404 * @brief the callback function type when display connect. 405 * 406 * @param displayId The added display id. 407 * @since 20 408 */ 409 typedef void (*OH_NativeDisplayManager_DisplayAddCallback)(uint64_t displayId); 410 411 /** 412 * @brief Register the callback for display connect listener. 413 * 414 * @param displayAddCallback display add callback. 415 * @param listenerIndex Indicates the pointer to an <b>uint32_t</b> object. used in unregister call. 416 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 417 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 418 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 419 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 420 * @since 20 421 */ 422 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayAddListener( 423 OH_NativeDisplayManager_DisplayAddCallback displayAddCallback, uint32_t *listenerIndex); 424 425 /** 426 * @brief Unregister the callback for display connect listener. 427 * 428 * @param listenerIndex The display add listener index. 429 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 430 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 431 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 432 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 433 * @since 20 434 */ 435 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayAddListener(uint32_t listenerIndex); 436 437 /** 438 * @brief the callback function type when display disconnect. 439 * 440 * @param displayId The removed display id. 441 * @since 20 442 */ 443 typedef void (*OH_NativeDisplayManager_DisplayRemoveCallback)(uint64_t displayId); 444 445 /** 446 * @brief Register the callback for display disconnect listener. 447 * 448 * @param displayRemoveCallback display remove callback. 449 * @param listenerIndex Indicates the pointer to an <b>uint32_t</b> object. used in unregister call. 450 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 451 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 452 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 453 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 454 * @since 20 455 */ 456 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayRemoveListener( 457 OH_NativeDisplayManager_DisplayRemoveCallback displayRemoveCallback, uint32_t *listenerIndex); 458 459 /** 460 * @brief Unregister the callback for display disconnect listener. 461 * 462 * @param listenerIndex The display remove listener index. 463 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 464 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 465 * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. 466 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 467 * @since 20 468 */ 469 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayRemoveListener(uint32_t listenerIndex); 470 471 /** 472 * @brief Get the source mode of the device. 473 * 474 * @param displayId The display id. 475 * @param sourceMode Indicates the pointer to an <b>NativeDisplayManager_SourceMode</b> object. 476 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 477 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 478 * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. 479 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 480 * @since 20 481 */ 482 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplaySourceMode(uint64_t displayId, NativeDisplayManager_SourceMode *sourceMode); 483 484 /** 485 * @brief Get the position of the device. 486 * 487 * @param displayId The display id. 488 * @param x The x-coordinate of the screen's top-left corner relative to the primary screen's origin (in px). 489 * @param y The y-coordinate of the screen's top-left corner relative to the primary screen's origin (in px). 490 * @return { @link DISPLAY_MANAGER_OK } If the operation is successful 491 * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. 492 * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. 493 * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. 494 * @since 20 495 */ 496 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplayPosition(uint64_t displayId, int32_t *x, int32_t *y); 497 498 #ifdef __cplusplus 499 } 500 #endif 501 /** @} */ 502 #endif // OH_NATIVE_DISPLAY_MANAGER_H 503