mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 15:17:33 +08:00
chore(lv_tree): Code reorganization for lv_tree.h (#8583)
This commit is contained in:
+15
-11
@@ -25,27 +25,31 @@ extern "C" {
|
|||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
struct _lv_tree_node_t;
|
typedef struct _lv_tree_class_t lv_tree_class_t;
|
||||||
|
typedef struct _lv_tree_node_t lv_tree_node_t;
|
||||||
|
|
||||||
|
typedef void (*lv_tree_constructor_cb_t)(const lv_tree_class_t * class_p, lv_tree_node_t * node);
|
||||||
|
typedef void (*lv_tree_destructor_cb_t)(const lv_tree_class_t * class_p, lv_tree_node_t * node);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describe the common methods of every object.
|
* Describe the common methods of every object.
|
||||||
* Similar to a C++ class.
|
* Similar to a C++ class.
|
||||||
*/
|
*/
|
||||||
typedef struct _lv_tree_class_t {
|
struct _lv_tree_class_t {
|
||||||
const struct _lv_tree_class_t * base_class;
|
const lv_tree_class_t * base_class;
|
||||||
uint32_t instance_size;
|
uint32_t instance_size;
|
||||||
void (*constructor_cb)(const struct _lv_tree_class_t * class_p, struct _lv_tree_node_t * node);
|
lv_tree_constructor_cb_t constructor_cb;
|
||||||
void (*destructor_cb)(const struct _lv_tree_class_t * class_p, struct _lv_tree_node_t * node);
|
lv_tree_destructor_cb_t destructor_cb;
|
||||||
} lv_tree_class_t;
|
};
|
||||||
|
|
||||||
/** Description of a tree node*/
|
/** Description of a tree node*/
|
||||||
typedef struct _lv_tree_node_t {
|
struct _lv_tree_node_t {
|
||||||
struct _lv_tree_node_t * parent;
|
lv_tree_node_t * parent;
|
||||||
struct _lv_tree_node_t ** children;
|
lv_tree_node_t ** children;
|
||||||
uint32_t child_cnt;
|
uint32_t child_cnt;
|
||||||
uint32_t child_cap;
|
uint32_t child_cap;
|
||||||
const struct _lv_tree_class_t * class_p;
|
const lv_tree_class_t * class_p;
|
||||||
} lv_tree_node_t;
|
};
|
||||||
|
|
||||||
enum _lv_tree_walk_mode_t {
|
enum _lv_tree_walk_mode_t {
|
||||||
LV_TREE_WALK_PRE_ORDER = 0,
|
LV_TREE_WALK_PRE_ORDER = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user