mirror of
https://github.com/lvgl/lvgl.git
synced 2026-08-17 17:51:57 +08:00
arch(file_explorer): deprecate and add a table-based file browser example
Deprecate the lv_file_explorer widget. A file explorer is a path header plus a table of directory entries read with the lv_fs API, so it can be built directly from base widgets. Following the deprecation guidelines: - @deprecated Doxygen tags and LV_DEPRECATED on lv_file_explorer_create - LV_LOG_DEPRECATED runtime warning in lv_file_explorer_create - migration-v10.mdx entry pointing to the replacement - the new lv_example_table_file_browser shows the recommended approach Live call sites in the kept legacy examples and the test are wrapped with LV_DEPRECATIONS_IGNORE_BEGIN/END so the -Wdeprecated -Werror build stays clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
André Costa
co-authored by
Claude Opus 4.8
parent
f7ae316b8a
commit
fb759bd01a
@@ -22,6 +22,16 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated and kept only for
|
||||
* backward compatibility. A file explorer is a path header plus a table of
|
||||
* directory entries read with the `lv_fs` API, so build it directly instead. See
|
||||
* the `lv_example_table_file_browser` example. All `lv_file_explorer_*`
|
||||
* functions below are deprecated.
|
||||
*/
|
||||
#define LV_FILE_EXPLORER_DEPRECATED_MSG \
|
||||
"lv_file_explorer is deprecated; build a file browser from a table + lv_fs instead. See the lv_example_table_file_browser example."
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -51,6 +61,15 @@ extern const lv_obj_class_t lv_file_explorer_class;
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create a file explorer object
|
||||
* @param parent pointer to an object, it will be the parent of the new explorer
|
||||
* @return pointer to the created file explorer
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. Build a file browser from
|
||||
* a table and the `lv_fs` API instead. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_create(lv_obj_t * parent);
|
||||
|
||||
/*=====================
|
||||
@@ -63,8 +82,9 @@ lv_obj_t * lv_file_explorer_create(lv_obj_t * parent);
|
||||
* @param obj pointer to a label object
|
||||
* @param dir the dir from 'lv_file_explorer_dir_t' enum.
|
||||
* @param path path
|
||||
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
void lv_file_explorer_set_quick_access_path(lv_obj_t * obj, lv_file_explorer_dir_t dir, const char * path);
|
||||
#endif
|
||||
|
||||
@@ -72,14 +92,18 @@ void lv_file_explorer_set_quick_access_path(lv_obj_t * obj, lv_file_explorer_dir
|
||||
* Set file_explorer sort
|
||||
* @param obj pointer to a file explorer object
|
||||
* @param sort the sort from 'lv_file_explorer_sort_t' enum.
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
void lv_file_explorer_set_sort(lv_obj_t * obj, lv_file_explorer_sort_t sort);
|
||||
|
||||
/**
|
||||
* Set the visibility of the "< Back" button
|
||||
* @param obj pointer to a file explorer object
|
||||
* @param show bool true/false, enable or disable button
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
void lv_file_explorer_show_back_button(lv_obj_t * obj, bool show);
|
||||
|
||||
/*=====================
|
||||
@@ -90,35 +114,45 @@ void lv_file_explorer_show_back_button(lv_obj_t * obj, bool show);
|
||||
* Get file explorer Selected file
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer selected file name
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
const char * lv_file_explorer_get_selected_file_name(const lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer cur path
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer cur path
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
const char * lv_file_explorer_get_current_path(const lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer file list obj(lv_table)
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer file table obj(lv_table)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_file_table(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer head area obj
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer head area obj(lv_obj)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_header(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer path obj(label)
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer path obj(lv_label)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_path_label(lv_obj_t * obj);
|
||||
|
||||
#if LV_FILE_EXPLORER_QUICK_ACCESS
|
||||
@@ -126,21 +160,27 @@ lv_obj_t * lv_file_explorer_get_path_label(lv_obj_t * obj);
|
||||
* Get file explorer head area obj
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer quick access area obj(lv_obj)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_quick_access_area(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer places list obj(lv_list)
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer places list obj(lv_list)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_places_list(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get file explorer device list obj(lv_list)
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return pointer to the file explorer device list obj(lv_list)
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_obj_t * lv_file_explorer_get_device_list(lv_obj_t * obj);
|
||||
#endif
|
||||
|
||||
@@ -148,7 +188,9 @@ lv_obj_t * lv_file_explorer_get_device_list(lv_obj_t * obj);
|
||||
* Set file_explorer sort
|
||||
* @param obj pointer to a file explorer object
|
||||
* @return the current mode from 'lv_file_explorer_sort_t'
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
lv_file_explorer_sort_t lv_file_explorer_get_sort(const lv_obj_t * obj);
|
||||
|
||||
/*=====================
|
||||
@@ -159,7 +201,9 @@ lv_file_explorer_sort_t lv_file_explorer_get_sort(const lv_obj_t * obj);
|
||||
* Open a specified path
|
||||
* @param obj pointer to a file explorer object
|
||||
* @param dir pointer to the path
|
||||
* @deprecated The `lv_file_explorer` widget is deprecated. See `lv_example_table_file_browser`.
|
||||
*/
|
||||
LV_DEPRECATED(LV_FILE_EXPLORER_DEPRECATED_MSG)
|
||||
void lv_file_explorer_open_dir(lv_obj_t * obj, const char * dir);
|
||||
|
||||
/**********************
|
||||
|
||||
Reference in New Issue
Block a user