From 786541a67e29409d160f9e30e0f62905cdd80da4 Mon Sep 17 00:00:00 2001 From: "@ran-zhao-yu" Date: Tue, 21 May 2024 22:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90CAPI=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: @ran-zhao-yu --- global/resource_management/BUILD.gn | 7 +++- .../include/resourcemanager/resmgr_common.h | 35 +++++++++---------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/global/resource_management/BUILD.gn b/global/resource_management/BUILD.gn index da91ccf2c..3db518153 100644 --- a/global/resource_management/BUILD.gn +++ b/global/resource_management/BUILD.gn @@ -30,9 +30,14 @@ ohos_ndk_headers("rawfile_header") { ohos_ndk_library("native_resmgr_ndk") { ndk_description_file = "./libnative_resmgr.ndk.json" - min_compact_version = "1" + min_compact_version = "12" output_name = "ohresmgr" output_extension = "so" + system_capability = "SystemCapability.Global.ResourceManager" + system_capability_headers = [ + "resourcemanager/ohresmgr.h", + "resourcemanager/resmgr_common.h", + ] } ohos_ndk_headers("native_resmgr_header") { diff --git a/global/resource_management/include/resourcemanager/resmgr_common.h b/global/resource_management/include/resourcemanager/resmgr_common.h index d6ef85885..4e9289e83 100644 --- a/global/resource_management/include/resourcemanager/resmgr_common.h +++ b/global/resource_management/include/resourcemanager/resmgr_common.h @@ -42,41 +42,41 @@ extern "C" { * * @since 12 */ -enum ResourceManager_ErrorCode { - /** Success */ +typedef enum ResourceManager_ErrorCode { + /** @error Success */ SUCCESS = 0, - /** Invalid input parameter */ + /** @error Invalid input parameter */ ERROR_CODE_INVALID_INPUT_PARAMETER = 401, - /** Invalid resource ID */ + /** @error Invalid resource ID */ ERROR_CODE_RES_ID_NOT_FOUND = 9001001, - /** Invalid resource name */ + /** @error Invalid resource name */ ERROR_CODE_RES_NOT_FOUND_BY_ID = 9001002, - /** No matching resource is found based on the resource ID */ + /** @error No matching resource is found based on the resource ID */ ERROR_CODE_RES_NAME_NOT_FOUND = 9001003, - /** No matching resource is found based on the resource name */ + /** @error No matching resource is found based on the resource name */ ERROR_CODE_RES_NOT_FOUND_BY_NAME = 9001004, - /** Invalid relative path */ + /** @error Invalid relative path */ ERROR_CODE_RES_PATH_INVALID = 9001005, - /** The resource is referenced cyclically */ + /** @error The resource is referenced cyclically */ ERROR_CODE_RES_REF_TOO_MUCH = 9001006, - /** Failed to format the resource obtained based on the resource ID */ + /** @error Failed to format the resource obtained based on the resource ID */ ERROR_CODE_RES_ID_FORMAT_ERROR = 9001007, - /** Failed to format the resource obtained based on the resource Name */ + /** @error Failed to format the resource obtained based on the resource Name */ ERROR_CODE_RES_NAME_FORMAT_ERROR = 9001008, - /** Failed to access the system resource */ + /** @error Failed to access the system resource */ ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED = 9001009, - /** Invalid overlay path */ + /** @error Invalid overlay path */ ERROR_CODE_OVERLAY_RES_PATH_INVALID = 9001010, - /** Out of memory */ + /** @error Out of memory */ ERROR_CODE_OUT_OF_MEMORY = 9001100, -}; +} ResourceManager_ErrorCode; /** * @brief Enumerates screen density types. * * @since 12 */ -enum ScreenDensity { +typedef enum ScreenDensity { /** Indicates small screen density. */ SCREEN_SDPI = 120, /** Indicates medium screen density. */ @@ -89,8 +89,7 @@ enum ScreenDensity { SCREEN_XXLDPI = 480, /** Indicates extra-extra-extra-large screen density. */ SCREEN_XXXLDPI = 640, -}; - +} ScreenDensity; #ifdef __cplusplus }; #endif