From ac591a3a9ca995e1d75befb06561853efb32e78a Mon Sep 17 00:00:00 2001 From: wanghui Date: Tue, 9 Sep 2025 16:08:49 +0800 Subject: [PATCH 1/2] add ndk interface Signed-off-by: wanghui --- .../kits/c/input/oh_input_manager.h | 205 ++++++++++++++++++ multimodalinput/kits/c/ohinput.ndk.json | 36 +++ 2 files changed, 241 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 8e3e7bd4942..d1dee3815fa 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -316,6 +316,200 @@ typedef enum Input_Result { INPUT_DEVICE_NO_POINTER = 3900010, } Input_Result; +enum CursorStyle { + + /* Default */ + + DEFAULT, + + /* East arrow */ + + EAST, + + /* West arrow */ + + WEST, + + /* South arrow */ + + SOUTH, + + /* North arrow */ + + NORTH, + + /* East-west arrow */ + + WEST_EAST, + + /* North-south arrow */ + + NORTH_SOUTH, + + /* North-east arrow*/ + + NORTH_EAST, + + /* North-west arrow*/ + + NORTH_WEST, + + /* South-east arrow*/ + + SOUTH_EAST, + + /* South-west arrow*/ + + SOUTH_WEST, + + /* Northeast and southwest adjustment*/ + + NORTH_EAST_SOUTH_WEST, + + /* Northwest and southeast adjustment*/ + + NORTH_WEST_SOUTH_EAST, + + /* Cross (accurate selection)*/ + + CROSS, + + /* Copy*/ + + CURSOR_COPY, + + /* Forbid*/ + + CURSOR_FORBID, + + /* Sucker*/ + + COLOR_SUCKER, + + /* Grabbing hand*/ + + HAND_GRABBING, + + /* Opening hand*/ + + HAND_OPEN, + + /* Hand-shaped pointer*/ + + HAND_POINTING, + + /* Help*/ + + HELP, + + /* Move*/ + + MOVE, + + /* Left and right resizing*/ + + RESIZE_LEFT_RIGHT, + + /* Up and down resizing*/ + + RESIZE_UP_DOWN, + + /* Screenshot crosshair*/ + + SCREENSHOT_CHOOSE, + + /* Screenshot*/ + + SCREENSHOT_CURSOR, + + /* Text selection*/ + + TEXT_CURSOR, + + /* Zoom in*/ + + ZOOM_IN, + + /* Zoom out*/ + + ZOOM_OUT, + + /* Scrolling east*/ + + MIDDLE_BTN_EAST, + + /* Scrolling west*/ + + MIDDLE_BTN_WEST, + + /* Scrolling south*/ + + MIDDLE_BTN_SOUTH, + + /* Scrolling north*/ + + MIDDLE_BTN_NORTH, + + /* Scrolling north and south*/ + + MIDDLE_BTN_NORTH_SOUTH, + + /* Scrolling northeast*/ + + MIDDLE_BTN_NORTH_EAST, + + /* Scrolling northwest*/ + + MIDDLE_BTN_NORTH_WEST, + + /* Scrolling southeast*/ + + MIDDLE_BTN_SOUTH_EAST, + + /* Scrolling southwest*/ + + MIDDLE_BTN_SOUTH_WEST, + + /* Moving as a cone in four directions*/ + + MIDDLE_BTN_NORTH_SOUTH_WEST_EAST, + + /* Horizontal text selection*/ + + HORIZONTAL_TEXT_CURSOR, + + /* Precise selection*/ + + CURSOR_CROSS, + + /* Cursor with circle style*/ + + CURSOR_CIRCLE, + + /* Loading state with dynamic cursor*/ + + LOADING, + + /* Running state with dynamic cursor*/ + + RUNNING, + + /* Scrolling east and west*/ + + MIDDLE_BTN_EAST_WEST, + + /* Screen recorder cursor*/ + + SCREENRECORDER_CURSOR = 48, + + LASER_CURSOR = 49, + LASER_CURSOR_DOT = 50, + LASER_CURSOR_DOT_RED = 51, + DEVELOPER_DEFINED_ICON = -100, + TRANSPARENT_ICON = -101, + +}; + /** * @brief Callback used to return shortcut key events. * @since 14 @@ -2111,6 +2305,17 @@ Input_Result OH_Input_QueryMaxTouchPoints(int32_t *count); * @since 20 */ Input_Result OH_Input_GetPointerLocation(int32_t *displayId, double *displayX, double *displayY); + +struct Input_CursorInfo* OH_Input_CreateCursorInfo(); +void OH_Input_DestroyCursorInfo(Input_CursorInfo* cursorInfo); +Input_Result OH_Input_GetCursorStyle(Input_CursorInfo* cursorInfo, CursorStyle* cursorStyle); +Input_Result OH_Input_GetCursorColor(Input_CursorInfo* cursorInfo, int32_t* cursorColor); +Input_Result OH_Input_GetCursorSize(Input_CursorInfo* cursorInfo, int32_t* cursorSize); +Input_Result OH_Input_GetCursorPixelmap(Input_CursorInfo* cursorInfo, OH_PixelmapNative* pixelmap); +Input_Result OH_Input_IsCursorVisible(Input_CursorInfo* cursorInfo, bool* visible); + +Input_Result OH_Input_GetMouseEventCursorInfo(const struct Input_MouseEvent* mouseEvent, Input_CursorInfo* cursorInfo); +Input_Result OH_Input_GetCursorInfo(Input_CursorInfo* cursorInfo); #ifdef __cplusplus } #endif diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 2747b8fa116..3a36b2a348c 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -569,5 +569,41 @@ { "first_introduced": "20", "name": "OH_Input_InjectTouchEventGlobal" + }, + { + "first_introduced": "20", + "name": "OH_Input_CreateCursorInfo" + }, + { + "first_introduced": "20", + "name": "OH_Input_DestroyCursorInfo" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetCursorStyle" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetCursorColor" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetCursorSize" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetCursorPixelmap" + }, + { + "first_introduced": "20", + "name": "OH_Input_IsCursorVisible" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetMouseEventCursorInfo" + }, + { + "first_introduced": "20", + "name": "OH_Input_GetCursorInfo" } ] \ No newline at end of file -- Gitee From 047a92fef55b45d1947478260f52894abce0084b Mon Sep 17 00:00:00 2001 From: wanghui Date: Tue, 9 Sep 2025 17:07:16 +0800 Subject: [PATCH 2/2] adjust Signed-off-by: wanghui --- .../ability_runtime/ability_runtime_common.h | 10 ++ .../ability_runtime/application_context.h | 75 +++++++++- .../libability_runtime.ndk.json | 12 ++ TEEKit/libteec.ndk.json | 4 +- arkui/ace_engine/native/libace.ndk.json | 4 + arkui/ace_engine/native/native_node.h | 131 ++++++++++++++++++ arkui/ace_engine/native/native_type.h | 16 +++ arkui/window_manager/libwm.ndk.json | 16 +++ arkui/window_manager/oh_window.h | 60 ++++++++ arkui/window_manager/oh_window_comm.h | 26 ++++ .../bundle_framework/bundle/BUILD.gn | 12 +- .../bundle/include/native_interface_bundle.h | 17 +++ .../bundle/libbundle.ndk.json | 40 ++++++ hiviewdfx/hilog/include/hilog/log.h | 40 +++++- hiviewdfx/hilog/libhilog.ndk.json | 4 + multimedia/camera_framework/photo_output.h | 1 + multimedia/player_framework/avplayer.h | 13 ++ .../avplayer/libavplayer.ndk.json | 4 + .../kits/c/input/oh_input_manager.h | 77 +++++++++- multimodalinput/kits/c/ohinput.ndk.json | 16 +++ third_party/musl/ndk_script/toolchain.sh | 3 + 21 files changed, 570 insertions(+), 11 deletions(-) diff --git a/AbilityKit/ability_runtime/ability_runtime_common.h b/AbilityKit/ability_runtime/ability_runtime_common.h index 7c2e98d4a63..bf736155281 100644 --- a/AbilityKit/ability_runtime/ability_runtime_common.h +++ b/AbilityKit/ability_runtime/ability_runtime_common.h @@ -143,6 +143,16 @@ typedef enum { * @since 21 */ ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED = 16000081, + /** + * @error Start UIAbility timeout. + * @since 21 + */ + ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT = 16000133, + /** + * @error The API does not support being called in the main thread. + * @since 21 + */ + ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED = 16000134, } AbilityRuntime_ErrorCode; #ifdef __cplusplus diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 00c5d579d45..af2d128fc67 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -294,7 +294,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityBase_Want * AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(AbilityBase_Want *want, AbilityRuntime_StartOptions *options); - /** +/** * @brief Obtain the version code of the application. * * @param versionCode The version code of the application. @@ -307,6 +307,79 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); +/** + * @brief Obtain the launch parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the launch parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the latest parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the latest parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Starts self UIAbility with start options and receives the process ID. + * + * @permission ohos.permission.NDK_START_SELF_UI_ABILITY + * @param want The arguments passed to start self UIAbility. + * For details, see {@link AbilityBase_Want}. + * @param options The start options passed to start self UIAbility. + * For details, see {@link AbilityRuntime_StartOptions}. + * @param targetPid The process ID of the started UIAbility. + * @return Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the call is successful. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the arguments provided is invalid. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED} if the device does not support starting self uiability. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY} if the target ability does not exist. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE} if the ability type is incorrect. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED} if the crowdtesting application expires. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE} if the ability cannot be started in Wukong mode. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CONTROLLED} if the app is controlled. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED} if the app is controlled by EDM. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_CROSS_APP} if the caller tries to start a different application. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INTERNAL} if internal error occurs. such as connect system service failed. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY} if the caller is not foreground process. + * Returns {@link ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED} if setting visibility is disabled. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED} + * if the app clone or multi-instance is not supported. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY} if the app instance key is invalid. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED} if the number of app instances reached the limit. + * Returns {@link ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED} if the multi-instance is not supported. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED} + * if the APP_INSTANCE_KEY cannot be specified. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT} if starting UIAbility time out. + * Returns {@link ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED} + * if the API is called in the main thread of the app. + * For details, see {@link AbilityRuntime_ErrorCode}. + * @since 21 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithPidResult(AbilityBase_Want *want, + AbilityRuntime_StartOptions *options, int32_t *targetPid); + #ifdef __cplusplus } // extern "C" #endif diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index f7939128e40..3f494e73845 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -178,9 +178,21 @@ { "first_introduced": "20", "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_ApplicationContextGetLaunchParameter" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_ApplicationContextGetLatestParameter" }, { "first_introduced": "21", "name": "OH_AbilityRuntime_ApplicationContextGetVersionCode" + }, + { + "first_introduced": "21", + "name": "OH_AbilityRuntime_StartSelfUIAbilityWithPidResult" } ] \ No newline at end of file diff --git a/TEEKit/libteec.ndk.json b/TEEKit/libteec.ndk.json index 68c534dd68e..0da258c0612 100644 --- a/TEEKit/libteec.ndk.json +++ b/TEEKit/libteec.ndk.json @@ -17,7 +17,7 @@ }, { "first_introduced": "20", - "name": "TTEEC_InvokeCommand" + "name": "TEEC_InvokeCommand" }, { "first_introduced": "20", @@ -35,4 +35,4 @@ "first_introduced": "20", "name": "TEEC_RequestCancellation" } -] \ No newline at end of file +] diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1e0b4c4dfee..dc3d30be4c1 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4134,5 +4134,9 @@ { "first_introduced": "21", "name": "OH_ArkUI_ListItemSwipeAction_Collapse" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_ContentTransitionEffect_Create" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 516876804a0..5cbcdce4fe3 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -946,6 +946,44 @@ typedef enum { * .value[1].f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. \n * .value[2].f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. * + * @since 12 + */ + /** + * @brief Defines the overlay attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: mask text.\n + * .value[0]?.i32: position of the overlay relative to the component. Optional. + * The parameter type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[1]?.f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. Optional. \n + * .value[2]?.f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. Optional. + * \n + * .value[3]?.i32: the layout direction. + * The parameter type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_LTR. \n + * In most cases, this parameter should be set to Auto, this allowing the system to handle + * the layout direction automatically. If you need to keep a specific direction in any situation, set it to + * either LTR (Left-to-Right) or RTL (Right-to-Left). Optional. + * \n + * .object: the node tree used as the overlay. + * The parameter type is {@link ArkUI_NodeHandle}. + * The default value is nullptr. \n + * this parameter is conflict with .string, and it has lower priority than .string. Optional. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: mask text.\n + * .value[0].i32: position of the overlay relative to the component. + * The parameter type is {@link ArkUI_Alignment}. + * The default value is ARKUI_ALIGNMENT_TOP_START. \n + * .value[1].f32: offset of the overlay relative to the upper left corner of itself on the x-axis, in vp. \n + * .value[2].f32: offset of the overlay relative to the upper left corner of itself on the y-axis, in vp. + * .value[3].i32: the layout direction. + * The parameter type is {@link ArkUI_Direction}. + * The default value is ARKUI_DIRECTION_LTR. \n + * .object: the overlay node handle. \n + * + * @since 21 */ NODE_OVERLAY, /** @@ -1250,6 +1288,21 @@ typedef enum { * */ NODE_MARK_ANCHOR, + + /** + * @brief Defines the position of the background image in the component, that is, the coordinates relative to + * the upper left corner of the component. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: position along the x-axis, in px. \n + * .value[1].f32: position along the y-axis, in px. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: position along the x-axis, in px. \n + * .value[1].f32: position along the y-axis, in px. \n + * + * @since 12 + */ /** * @brief Defines the position of the background image in the component, that is, the coordinates relative to * the upper left corner of the component. This attribute can be set, reset, and obtained as required through APIs. @@ -2953,6 +3006,19 @@ typedef enum { * @since 21 */ NODE_IMAGE_SUPPORT_SVG2 = 4021, + /** + * @brief Set the animation effect for the image content transformation. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: The parameter type is {@link ArkUI_ContentTransitionEffect}.\n + * + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: The parameter type is {@link ArkUI_ContentTransitionEffect}.\n + * + * @since 21 + */ + NODE_IMAGE_CONTENT_TRANSITION = 4022, /** * @brief Defines the color of the component when it is selected. * This attribute can be set, reset, and obtained as required through APIs. @@ -5081,6 +5147,71 @@ typedef enum { */ NODE_SLIDER_SUFFIX, + /** + * @brief Defines the color of the slider block. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_BLOCK_LINEAR_GRADIENT_COLOR, + + /** + * @brief Defines the background color of the slider. This attribute can be set, reset, and obtained as required + * through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_TRACK_LINEAR_GRADIENT_COLOR, + + /** + * @brief Defines the color of the selected part of the slider track. This attribute can be set, reset, and obtained + * as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: array of color stops, each of which consists of a color and its stop position. + * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n + * colors: colors of the color stops. \n + * stops: stop positions of the color stops. \n + * size: number of colors. \n + * + * @since 21 + */ + NODE_SLIDER_SELECTED_LINEAR_GRADIENT_COLOR, + /** * @brief Set the selection status of an option button. Attribute setting, * attribute resetting, and attribute obtaining are supported. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index e43a92fa2e6..06813a6f04f 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -4043,6 +4043,22 @@ const char* OH_ArkUI_BarrierOption_GetReferencedId( */ int32_t OH_ArkUI_BarrierOption_GetReferencedIdSize(ArkUI_BarrierOption* barrierStyle, int32_t index); +/** + * @brief Set the types and parameters related to content transition effects. + * + * @since 21 + */ +typedef struct ArkUI_ContentTransitionEffect ArkUI_ContentTransitionEffect; + +/** + * @brief creates content switching animation effects. + * + * @param type content transition type: 0-identity, 1-opacity. + * @return content transition effect. + * @since 21 + */ +ArkUI_ContentTransitionEffect* OH_ArkUI_ContentTransitionEffect_Create(int32_t type); + /** * @brief creates alignment rule information for subcomponents in relative containers. * diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 4f4f24f91b1..8bb60641f1b 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -203,5 +203,21 @@ { "first_instroduced":"20", "name":"OH_PictureInPicture_UnregisterAllResizeListeners" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_GetAllMainWindowInfo" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_ReleaseAllMainWindowInfo" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_GetMainWindowSnapshot" + }, + { + "first_instroduced":"21", + "name":"OH_WindowManager_ReleaseMainWindowSnapshot" } ] \ No newline at end of file diff --git a/arkui/window_manager/oh_window.h b/arkui/window_manager/oh_window.h index 347d1000275..b99d6f4a7e0 100644 --- a/arkui/window_manager/oh_window.h +++ b/arkui/window_manager/oh_window.h @@ -289,6 +289,66 @@ void OH_WindowManager_ReleaseAllWindowLayoutInfoList(WindowManager_Rect* windowL int32_t OH_WindowManager_InjectTouchEvent( int32_t windowId, Input_TouchEvent* touchEvent, int32_t windowX, int32_t windowY); +/** + * @brief Get all main window info on device. + * + * @permission ohos.permission.CUSTOM_SCREEN_CAPTURE + * @param infoList Indicates the pointer to a main window info list. + * @param mainWindowInfoSize The size of main window info list. + * @return Returns the status code of the execution. + * {@link WS_OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_NO_PERMISSION} permission verification failed. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL} the window manager service works abnormally. + * @since 21 + */ +int32_t OH_WindowManager_GetAllMainWindowInfo( + WindowManager_MainWindowInfo** infoList, size_t* mainWindowInfoSize); + +/** + * @brief Release all main window info list. + * + * @param infoList Pointer to the main window info list. + * @since 21 + */ +void OH_WindowManager_ReleaseAllMainWindowInfo(WindowManager_MainWindowInfo* infoList); + +/** + * @brief Callback interface for getting main windows' snapshot. + * + * @param snapshotPixelMapList List of windows' snapshot + * @param snapshotListSize Size of snapshotPixelMapList + * @since 21 + */ +typedef void (*OH_WindowManager_WindowSnapshotCallback)(const OH_PixelmapNative* snapshotPixelMapList, + size_t snapshotListSize); + +/** + * @brief Get snapshot of the specified windows. + * + * @permission ohos.permission.CUSTOM_SCREEN_CAPTURE + * @param windowIdList Main window id list for getting snapshot. + * @param windowIdListSize Size of main window id list. + * @param config Configuration for getting snapshot. + * @param callback Snapshot callback object. + * @return Returns the status code of the execution. + * {@link WS_OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_NO_PERMISSION} permission verification failed. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL} the window manager service works abnormally. + * @since 21 + */ +int32_t OH_WindowManager_GetMainWindowSnapshot(int32_t* windowIdList, size_t windowIdListSize, + WindowManager_WindowSnapshotConfig config, OH_WindowManager_WindowSnapshotCallback callback); + +/** + * @brief Release main window snapshot list. + * + * @param snapshotPixelMapList Indicates the pointer of a windows' snapshot list. + * @since 21 + */ +void OH_WindowManager_ReleaseMainWindowSnapshot(const OH_PixelmapNative* snapshotPixelMapList); + #ifdef __cplusplus } #endif diff --git a/arkui/window_manager/oh_window_comm.h b/arkui/window_manager/oh_window_comm.h index 152c9a31827..ad05a16950f 100644 --- a/arkui/window_manager/oh_window_comm.h +++ b/arkui/window_manager/oh_window_comm.h @@ -229,6 +229,32 @@ typedef struct { WindowManager_Rect bottomRect; } WindowManager_AvoidArea; +/** + * @brief Main window info + * + * @since 21 + */ +typedef struct { + /** Display id of the window. */ + uint64_t displayId; + /** Window id. */ + int32_t windowId; + /** Showing state of the window. */ + bool showing; + /** Label of the window. */ + const char* label; +} WindowManager_MainWindowInfo; + +/** + * @brief Window snapshot config info + * + * @since 21 + */ +typedef struct { + /** Use cached windows' snapshot. */ + bool useCache; +} WindowManager_WindowSnapshotConfig; + #ifdef __cplusplus } #endif diff --git a/bundlemanager/bundle_framework/bundle/BUILD.gn b/bundlemanager/bundle_framework/bundle/BUILD.gn index 22dfebfab4a..5f7c039ef55 100644 --- a/bundlemanager/bundle_framework/bundle/BUILD.gn +++ b/bundlemanager/bundle_framework/bundle/BUILD.gn @@ -18,7 +18,11 @@ config("bundle_ndk_config") { } ohos_ndk_headers("bundle_header") { dest_dir = "$ndk_headers_out_dir/bundle/" - sources = [ "./include/native_interface_bundle.h" ] + sources = [ + "./include/ability_resource_info.h", + "./include/bundle_manager_common.h", + "./include/native_interface_bundle.h", + ] } ohos_ndk_library("libbundle_ndk") { @@ -26,5 +30,9 @@ ohos_ndk_library("libbundle_ndk") { min_compact_version = "9" output_name = "bundle_ndk" system_capability = "SystemCapability.BundleManager.BundleFramework.Core" - system_capability_headers = [ "bundle/native_interface_bundle.h" ] + system_capability_headers = [ + "bundle/native_interface_bundle.h", + "bundle/bundle_manager_common.h", + "bundle/ability_resource_info.h", + ] } diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index d1b0201e4fb..9b7867ba143 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -40,6 +40,9 @@ #include #include +#include "ability_resource_info.h" +#include "bundle_manager_common.h" + #ifdef __cplusplus extern "C" { #endif @@ -224,6 +227,20 @@ bool OH_NativeBundle_IsDebugMode(bool* isDebugMode); * @since 20 */ OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); + +/** + * @brief Obtain a list of ability that support opening files in a certain format. + * + * @permisssion {@code ohos.permission.GET_ABILITY_INFO}. + * @param fileType Indicates the file type. + * @param abilityResourceInfo Indicates the ability resource array. + * @param size Indicates the ability resource array size. + * @return Returns {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the call is successful. + * Returns {@link BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAbilityResourceInfo(char* fileType, + OH_NativeBundle_AbilityResourceInfo** abilityResourceInfo, size_t* size); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index 7c05eef7bb2..a21ec324459 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -26,5 +26,45 @@ { "first_introduced": "20", "name": "OH_NativeBundle_GetModuleMetadata" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityResourceInfo" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetBundleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetModuleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetIcon" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetLabel" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAppIndex" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_CheckDefaultApp" + }, + { + "first_introduced": "21", + "name": "OH_AbilityResourceInfo_Destroy" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetSize" } ] diff --git a/hiviewdfx/hilog/include/hilog/log.h b/hiviewdfx/hilog/include/hilog/log.h index 1c4cda70470..4856a0df249 100644 --- a/hiviewdfx/hilog/include/hilog/log.h +++ b/hiviewdfx/hilog/include/hilog/log.h @@ -22,9 +22,6 @@ * For example, you can use these functions to output logs of the specified log type, service domain, log tag, * and log level. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiLog - * * @since 8 */ @@ -55,7 +52,9 @@ * Output result:\n * 05-06 15:01:06.870 1051 1051 W 0201/MY_TAG: Failed to visit , reason:503.\n * - * @library libhilog.so + * @kit PerformanceAnalysisKit + * @include + * @library libhilog_ndk.z.so * @syscap SystemCapability.HiviewDFX.HiLog * @since 8 */ @@ -133,6 +132,30 @@ typedef enum { LOG_FATAL = 7, } LogLevel; +/** + * @brief Enumerates preference strategy to be used in {@link OH_LOG_SetLogLevel}. + * + * You are advised to select preference strategy based on their respective usage scenarios. + * + * @since 21 + */ +typedef enum { + /** Used to unset SetLogLevel, then none is set + */ + UNSET_LOGLEVEL = 0, + /** + * The actual lowest log level is determined by + * the maximum level between the new level and the system-controlled level. + * This is equivalent to calling OH_LOG_SetMinLogLevel. + */ + PREFER_CLOSE_LOG = 1, + /** + * The actual lowest log level is determined by + * the minimum level between the new level and the system-controlled level. + */ + PREFER_OPEN_LOG = 2, +} PreferStrategy; + /** * @brief Outputs logs. * @@ -351,6 +374,15 @@ void OH_LOG_SetCallback(LogCallback callback); */ void OH_LOG_SetMinLogLevel(LogLevel level); +/** + * @brief Sets the lowest log level of the current application process. Different preference strategy can be set. + * + * @param level log level. + * @param prefer preference strategy. See {@link PreferStrategy}. + * @since 21 + */ +void OH_LOG_SetLogLevel(LogLevel level, PreferStrategy prefer); + #ifdef __cplusplus } #endif diff --git a/hiviewdfx/hilog/libhilog.ndk.json b/hiviewdfx/hilog/libhilog.ndk.json index 0d14010e04c..2f06e93a984 100644 --- a/hiviewdfx/hilog/libhilog.ndk.json +++ b/hiviewdfx/hilog/libhilog.ndk.json @@ -19,5 +19,9 @@ }, { "name": "OH_LOG_SetMinLogLevel" + }, + { + "first_instroduced":"21", + "name": "OH_LOG_SetLogLevel" } ] diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index fd7b3b415ff..90b5161d624 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -507,6 +507,7 @@ Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutpu * @param isSupported the result of whether quality prioritization is supported. * @return {@link #CAMERA_OK} if the method call succeeds. * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. * @since 21 */ diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 9f89bc00c2a..d206b6d46ed 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -47,6 +47,7 @@ #include "avplayer_base.h" #include "native_window/external_window.h" #include "ohaudio/native_audiostream_base.h" +#include "native_avcodec_base.h" #ifdef __cplusplus extern "C" { @@ -644,6 +645,18 @@ OH_AVErrCode OH_AVPlayer_SetVolumeMode(OH_AVPlayer *player, OH_AudioStream_Volum */ OH_AVErrCode OH_AVPlayer_SetLoudnessGain(OH_AVPlayer *player, float loudnessGain); +/** + * @brief Set the media source of the player. The data of this media source is provided by the application. + * @param {OH_AVPlayer*} player Pointer to an OH_AVPlayer instance + * @param {OH_AVDataSourceExt*} datasrc Pointer to an OH_AVDataSourceExt instance + * @param {void*} userData The handle passed in by the user is used to pass in the callback + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or datasrc is nullptr. + * @since 21 + */ +OH_AVErrCode OH_AVPlayer_SetDataSource(OH_AVPlayer *player, OH_AVDataSourceExt* datasrc, void* userData); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json index 787c34354f8..2b372fe8fa0 100644 --- a/multimedia/player_framework/avplayer/libavplayer.ndk.json +++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json @@ -150,5 +150,9 @@ { "first_introduced": "21", "name": "OH_AVPlayer_SetLoudnessGain" + }, + { + "first_introduced": "21", + "name": "OH_AVPlayer_SetDataSource" } ] \ No newline at end of file diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index d1dee3815fa..e0822ad9d1d 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -316,7 +316,7 @@ typedef enum Input_Result { INPUT_DEVICE_NO_POINTER = 3900010, } Input_Result; -enum CursorStyle { +typedef enum CursorStyle { /* Default */ @@ -508,7 +508,11 @@ enum CursorStyle { DEVELOPER_DEFINED_ICON = -100, TRANSPARENT_ICON = -101, -}; +} CursorStyle; + +typedef struct OH_PixelmapNative OH_PixelmapNative; + +typedef struct Input_CursorInfo Input_CursorInfo; /** * @brief Callback used to return shortcut key events. @@ -834,6 +838,75 @@ void OH_Input_SetKeyEventDisplayId(struct Input_KeyEvent* keyEvent, int32_t disp */ int32_t OH_Input_GetKeyEventDisplayId(const struct Input_KeyEvent* keyEvent); +/** + * @brief Get the eventId of the keyEvent. + * + * @param keyEvent - Key event object. + * @param eventId - Get the keyEvent eventId. + * @return OH_Input_GetKeyEventId function result code. + * {@link INPUT_SUCCESS} Get the eventId of the keyEvent success.\n + * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n + * @since 21 + */ + +Input_Result OH_Input_GetKeyEventId(const struct Input_KeyEvent* keyEvent, int32_t* eventId); + +/** + * @brief Add a keyEvent interception hook function. Before using this interface, + * the user needs to authorize it in the settings. + * + * @permission ohos.permission.HOOK_KEY_EVENT + * @param callback - Hook function, keyEvent will be sent to the hook function for priority processing. + * @return OH_Input_AddKeyEventHook function result code. + * {@link INPUT_SUCCESS} Added hook function successfully.\n + * {@link INPUT_PARAMETER_ERROR} Failed to add the hook function. Reason: Parameter check failed.\n + * {@link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n + * {@link INPUT_PERMISSION_DENIED} Failed to add the hook function. Reason: Permission check failed.\n + * {@link INPUT_REPEAT_INTERCEPTOR} Failed to add the hook function.\n + * Reason: Repeatedly set the hook function. A process can only have one key hook function.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to add the hook function.\n + * Reason: Input service exception, please try again.\n + * @since 21 + */ +Input_Result OH_Input_AddKeyEventHook(Input_KeyEventCallback callback); + +/** + * @brief Remove keyEvent interception hook function. + * + * @param callback - Hook function, Same as the parameters when calling OH_Input_AddKeyEventHook. + * @return OH_Input_RemoveKeyEventHook function result code. + * {@link INPUT_SUCCESS} Hook function removed successfully.\n + * Even if the hook function has not been added before, it will return success when removed.\n + * {@link INPUT_PARAMETER_ERROR} Failed to remove the hook function. Reason: Parameter check failed.\n + * {@link INPUT_SERVICE_EXCEPTION} Failed to remove the hook function.\n + * Reason: Input service exception, please try again.\n + * @since 21 + */ +Input_Result OH_Input_RemoveKeyEventHook(Input_KeyEventCallback callback); + +/** + * @brief Redispatches keyEvent. + * Only keyEvent intercepted by hook functions can be redispatched, + * and the event order must be maintained during redispatching. + * The hook function intercepts the input event and then redistributes it for 3 seconds. + * If this time is exceeded, calling this function will return INPUT_PARAMETER_ERROR. + * Re-dispatching requires event pairing, usually starting with one or more KEY_ACTION_DOWN and + * ending with KEY_ACTION_UP or KEY_ACTION_CANCEL. + * Only KEY_ACTION_UP or KEY_ACTION_CANCEL is redispatched, the function call succeeds, + * but no actual dispatch is made. + * If an event is dispatched that is not intercepted by the hook function, + * the function call succeeds, but no actual dispatch action is taken. + * + * @param eventId - keyEvent eventId. + * @return OH_Input_DispatchToNextHandler function result code. + * {@link INPUT_SUCCESS} Redistribution successful.\n + * {@link INPUT_PARAMETER_ERROR} Redistribution failed. Reason: KeyEvent does not exist.\n + * {@link INPUT_SERVICE_EXCEPTION} Redistribution failed.\n + * Reason: Input service exception, it's recommended to reset the pending distribution status.\n + * @since 21 + */ +Input_Result OH_Input_DispatchToNextHandler(int32_t eventId); + /** * @brief Inject mouse event. * since API 20, it is recommended to use OH_Input_RequestInjection diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 3a36b2a348c..a41dc2a322a 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -570,6 +570,22 @@ "first_introduced": "20", "name": "OH_Input_InjectTouchEventGlobal" }, + { + "first_introduced": "21", + "name": "OH_Input_GetKeyEventId" + }, + { + "first_introduced": "21", + "name": "OH_Input_AddKeyEventHook" + }, + { + "first_introduced": "21", + "name": "OH_Input_RemoveKeyEventHook" + }, + { + "first_introduced": "21", + "name": "OH_Input_DispatchToNextHandler" + }, { "first_introduced": "20", "name": "OH_Input_CreateCursorInfo" diff --git a/third_party/musl/ndk_script/toolchain.sh b/third_party/musl/ndk_script/toolchain.sh index db0cf489e50..fab8b897981 100755 --- a/third_party/musl/ndk_script/toolchain.sh +++ b/third_party/musl/ndk_script/toolchain.sh @@ -74,3 +74,6 @@ function remove_unnecessary_file() { } remove_unnecessary_file strip_dir ${OUT_DIR}/lib +if [ -f "${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so" ]; then + ${TOOL_DIR}/llvm-strip ${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so +fi -- Gitee