diff --git a/docs/src/changelog/migration-v10.mdx b/docs/src/changelog/migration-v10.mdx index cd3d53f017..a06fbb6b8d 100644 --- a/docs/src/changelog/migration-v10.mdx +++ b/docs/src/changelog/migration-v10.mdx @@ -473,3 +473,12 @@ if you need finer control. so build it directly instead. See the [`lv_example_table_file_browser`](widgets/table#building-a-file-explorer) example for a starting point. + +--- + +## Libraries + +### rlottie + +- The rlottie player is deprecated. Use the [`lv_lottie`](widgets/lottie) widget + instead. diff --git a/examples/libs/rlottie/lv_example_rlottie_1.c b/examples/libs/rlottie/lv_example_rlottie_1.c index f56dcd9312..0f3773d65f 100644 --- a/examples/libs/rlottie/lv_example_rlottie_1.c +++ b/examples/libs/rlottie/lv_example_rlottie_1.c @@ -6,6 +6,8 @@ * @title Rlottie animation from array * @brief Play a Lottie animation decoded from a JSON byte array in flash. * + * @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. + * * `lv_rlottie_create_from_raw` builds a 100x100 Lottie widget from the * externally declared `lv_example_rlottie_approve` JSON data, and the * widget is centered on the active screen. @@ -13,7 +15,9 @@ void lv_example_rlottie_1(void) { extern const uint8_t lv_example_rlottie_approve[]; + LV_DEPRECATIONS_IGNORE_BEGIN lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_screen_active(), 100, 100, (const char *)lv_example_rlottie_approve); + LV_DEPRECATIONS_IGNORE_END lv_obj_center(lottie); } diff --git a/examples/libs/rlottie/lv_example_rlottie_2.c b/examples/libs/rlottie/lv_example_rlottie_2.c index b7781ae7d6..03982bd1d3 100644 --- a/examples/libs/rlottie/lv_example_rlottie_2.c +++ b/examples/libs/rlottie/lv_example_rlottie_2.c @@ -6,6 +6,8 @@ * @title Rlottie animation from file * @brief Play a Lottie JSON file loaded directly through the rlottie stdio path. * + * @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. + * * `lv_rlottie_create_from_file` opens * `lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json` as a 100x100 * widget centered on the active screen. The path has no LVGL drive letter @@ -15,8 +17,10 @@ void lv_example_rlottie_2(void) { /*The rlottie library uses STDIO file API, so there is no driver letter for LVGL*/ + LV_DEPRECATIONS_IGNORE_BEGIN lv_obj_t * lottie = lv_rlottie_create_from_file(lv_screen_active(), 100, 100, "lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json"); + LV_DEPRECATIONS_IGNORE_END lv_obj_center(lottie); } diff --git a/include/lvgl/widgets/lv_rlottie.h b/include/lvgl/widgets/lv_rlottie.h index 1d3c3e4fe1..baec8c536a 100644 --- a/include/lvgl/widgets/lv_rlottie.h +++ b/include/lvgl/widgets/lv_rlottie.h @@ -14,12 +14,20 @@ extern "C" { * INCLUDES *********************/ #include "../config/lv_conf_internal.h" +#include "../lv_types.h" #if LV_USE_RLOTTIE /********************* * DEFINES *********************/ +/** + * @deprecated The rlottie player is deprecated and kept only for backward + * compatibility. Use the `lv_lottie` widget instead. See the Lottie widget docs. + */ +#define LV_RLOTTIE_DEPRECATED_MSG \ + "rlottie is deprecated; use the lv_lottie widget instead." + /********************** * TYPEDEFS **********************/ @@ -37,12 +45,27 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_rlottie_class; * GLOBAL PROTOTYPES **********************/ +/** + * Create an rlottie animation from a JSON file. + * @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. + */ +LV_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG) lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, int32_t width, int32_t height, const char * path); +/** + * Create an rlottie animation from a raw JSON description. + * @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. + */ +LV_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG) lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, int32_t width, int32_t height, const char * rlottie_desc); +/** @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. */ +LV_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG) void lv_rlottie_set_play_mode(lv_obj_t * rlottie, const lv_rlottie_ctrl_t ctrl); + +/** @deprecated rlottie is deprecated. Use the `lv_lottie` widget instead. */ +LV_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG) void lv_rlottie_set_current_frame(lv_obj_t * rlottie, const size_t goto_frame); /********************** diff --git a/src/libs/rlottie/lv_rlottie.c b/src/libs/rlottie/lv_rlottie.c index 1bc81ba5f5..aa65f866e2 100644 --- a/src/libs/rlottie/lv_rlottie.c +++ b/src/libs/rlottie/lv_rlottie.c @@ -64,6 +64,7 @@ static lv_rlottie_create_info_t create_info; lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, int32_t width, int32_t height, const char * path) { + LV_LOG_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG); create_info.width = width; create_info.height = height; create_info.path = path; @@ -78,6 +79,7 @@ lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, int32_t width, int32_t lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, int32_t width, int32_t height, const char * rlottie_desc) { + LV_LOG_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG); create_info.width = width; create_info.height = height; create_info.rlottie_desc = rlottie_desc; @@ -92,6 +94,7 @@ lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, int32_t width, int32_t void lv_rlottie_set_play_mode(lv_obj_t * obj, const lv_rlottie_ctrl_t ctrl) { + LV_LOG_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG); lv_rlottie_t * rlottie = (lv_rlottie_t *) obj; rlottie->play_ctrl = ctrl; @@ -103,6 +106,7 @@ void lv_rlottie_set_play_mode(lv_obj_t * obj, const lv_rlottie_ctrl_t ctrl) void lv_rlottie_set_current_frame(lv_obj_t * obj, const size_t goto_frame) { + LV_LOG_DEPRECATED(LV_RLOTTIE_DEPRECATED_MSG); lv_rlottie_t * rlottie = (lv_rlottie_t *) obj; rlottie->current_frame = goto_frame < rlottie->total_frames ? goto_frame : rlottie->total_frames - 1; }