From 4539857756524edf49c2382c741b221ec1c7cd0b Mon Sep 17 00:00:00 2001 From: yangxu Date: Thu, 22 May 2025 14:45:59 +0800 Subject: [PATCH 1/2] modify api 20 Signed-off-by: yangxu --- arkui/display_manager/oh_display_info.h | 3 ++ arkui/display_manager/oh_display_manager.h | 38 ++++++++++------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h index dca5c52f0..641a72486 100644 --- a/arkui/display_manager/oh_display_info.h +++ b/arkui/display_manager/oh_display_info.h @@ -126,6 +126,9 @@ typedef enum { /** @error Operation system abnormal */ DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL = 1400003, + + /** @error Operation illegal param */ + DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM = 1400004, } NativeDisplayManager_ErrorCode; /** diff --git a/arkui/display_manager/oh_display_manager.h b/arkui/display_manager/oh_display_manager.h index 484fcbe92..176f9c9cd 100644 --- a/arkui/display_manager/oh_display_manager.h +++ b/arkui/display_manager/oh_display_manager.h @@ -347,7 +347,6 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreatePrimaryDisplay( * @brief the callback function type when available area change. * * @param displayId The changed display id. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ typedef void (*OH_NativeDisplayManager_AvailableAreaChangeCallback)(uint64_t displayId); @@ -358,10 +357,9 @@ typedef void (*OH_NativeDisplayManager_AvailableAreaChangeCallback)(uint64_t dis * @param availableAreaChangeCallback Available area change callback. * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterAvailableAreaChangeListener( @@ -372,16 +370,15 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterAvailableAreaChan * * @param listenerIndex The display changed listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterAvailableAreaChangeListener(uint32_t listenerIndex); /** - * @brief Obtain the available area. + * @brief Create the available area. * * @param displayId The display id. * @param availableArea Indicates the pointer to an NativeDisplayManager_Rect object. @@ -389,16 +386,24 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterAvailableAreaCh * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ -NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetAvailableArea(uint64_t displayId, NativeDisplayManager_Rect **availableArea); +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAvailableArea(uint64_t displayId, NativeDisplayManager_Rect **availableArea); + +/** + * @brief Destroy an NativeDisplayManager_Rect object and reclaims the memory occupied by the object. + * + * @param availableArea Indicates the pointer to an NativeDisplayManager_Rect object. + * @return { @link DISPLAY_MANAGER_OK } If the operation is successful + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. + * @since 20 + */ +NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyAvailableArea(NativeDisplayManager_Rect *availableArea); /** * @brief the callback function type when display connect. * * @param displayId The added display id. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ typedef void (*OH_NativeDisplayManager_DisplayAddCallback)(uint64_t displayId); @@ -410,9 +415,8 @@ typedef void (*OH_NativeDisplayManager_DisplayAddCallback)(uint64_t displayId); * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayAddListener( @@ -424,9 +428,8 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayAddListene * @param listenerIndex The display add listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayAddListener(uint32_t listenerIndex); @@ -435,7 +438,6 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayAddListe * @brief the callback function type when display disconnect. * * @param displayId The removed display id. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ typedef void (*OH_NativeDisplayManager_DisplayRemoveCallback)(uint64_t displayId); @@ -447,9 +449,8 @@ typedef void (*OH_NativeDisplayManager_DisplayRemoveCallback)(uint64_t displayId * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayRemoveListener( @@ -461,9 +462,8 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayRemoveList * @param listenerIndex The display remove listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. - * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. + * { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayRemoveListener(uint32_t listenerIndex); @@ -477,7 +477,6 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayRemoveLi * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplaySourceMode(uint64_t displayId, NativeDisplayManager_SourceMode *sourceMode); @@ -492,7 +491,6 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplaySourceMode(uint * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. * { @link DISPLAY_MANAGER_ERROR_INVALID_SCREEN } Invalid screen. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. - * @syscap SystemCapability.Window.SessionManager * @since 20 */ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplayPosition(uint64_t displayId, int32_t *x, int32_t *y); -- Gitee From ecd722948a6630afe5ea9cda50fa8df9969e9850 Mon Sep 17 00:00:00 2001 From: yangxu Date: Thu, 22 May 2025 20:09:33 +0800 Subject: [PATCH 2/2] modify api 20 Signed-off-by: yangxu --- arkui/display_manager/libdm.ndk.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arkui/display_manager/libdm.ndk.json b/arkui/display_manager/libdm.ndk.json index 117063d6a..73f2204c2 100644 --- a/arkui/display_manager/libdm.ndk.json +++ b/arkui/display_manager/libdm.ndk.json @@ -113,7 +113,11 @@ }, { "first_instroduced":"20", - "name":"OH_NativeDisplayManager_GetAvailableArea" + "name":"OH_NativeDisplayManager_CreateAvailableArea" + }, + { + "first_instroduced":"20", + "name":"OH_NativeDisplayManager_DestroyAvailableArea" }, { "first_instroduced":"20", -- Gitee