From 4554f5d9c3640fff45979f3bae8f8ea1a2ff5895 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sat, 29 May 2021 09:32:19 +0200 Subject: [PATCH] fix try a different approach to make structs private --- src/core/lv_event.h | 18 +- src/core/lv_group.h | 17 +- src/core/lv_obj.h | 9 +- src/core/lv_obj_class.c | 4 +- src/core/lv_obj_class.h | 24 ++- src/core/lv_obj_draw.h | 18 +- src/core/lv_obj_pos.c | 2 +- src/core/lv_obj_pos.h | 85 ++++---- src/core/lv_obj_scroll.c | 14 +- src/core/lv_obj_scroll.h | 51 ++--- src/core/lv_obj_style.c | 2 +- src/core/lv_obj_style.h | 37 ++-- src/core/lv_obj_style_gen.h | 356 +++++++++++++++---------------- src/core/lv_obj_tree.h | 32 +-- src/core/lv_theme.h | 5 +- src/draw/lv_img_decoder.h | 19 +- src/extra/layouts/flex/lv_flex.c | 2 +- src/extra/layouts/grid/lv_grid.c | 4 +- src/extra/layouts/grid/lv_grid.h | 22 +- src/font/lv_font.h | 11 +- src/hal/lv_hal_disp.h | 34 +-- src/hal/lv_hal_indev.h | 24 ++- src/misc/lv_anim.h | 17 +- src/misc/lv_color.h | 4 +- src/misc/lv_fs.h | 25 ++- src/misc/lv_timer.h | 4 +- 26 files changed, 446 insertions(+), 394 deletions(-) diff --git a/src/core/lv_event.h b/src/core/lv_event.h index f07aa2845..82b4663e9 100644 --- a/src/core/lv_event.h +++ b/src/core/lv_event.h @@ -82,8 +82,8 @@ typedef enum { }lv_event_code_t; typedef struct _lv_event_t { - struct _lv_obj_t * target; - struct _lv_obj_t * current_target; + lv_obj_t * target; + lv_obj_t * current_target; lv_event_code_t code; void * user_data; void * param; @@ -135,7 +135,7 @@ typedef struct { * @param param arbitrary data depending on the widget type and the event. (Usually `NULL`) * @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event_code */ -lv_res_t lv_event_send(struct _lv_obj_t * obj, lv_event_code_t event_code, void * param); +lv_res_t lv_event_send(lv_obj_t * obj, lv_event_code_t event_code, void * param); /** * Used by the widgets internally to call the ancestor widget types's event handler @@ -150,7 +150,7 @@ lv_res_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e); * @param e pointer to the event descriptor * @return the target of the event_code */ -struct _lv_obj_t * lv_event_get_target(lv_event_t * e); +lv_obj_t * lv_event_get_target(lv_event_t * e); /** * Get the current target of the event. It's the object which event handler being called. @@ -158,7 +158,7 @@ struct _lv_obj_t * lv_event_get_target(lv_event_t * e); * @param e pointer to the event descriptor * @return pointer to the current target of the event_code */ -struct _lv_obj_t * lv_event_get_current_target(lv_event_t * e); +lv_obj_t * lv_event_get_current_target(lv_event_t * e); /** * Get the event code of an event @@ -200,7 +200,7 @@ uint32_t lv_event_register_id(void); * Mark this object's `event_temp_data` deleted to know that it's `lv_event_send` should return `LV_RES_INV` * @param obj pointer to an obejct to mark as deleted */ -void _lv_event_mark_deleted(struct _lv_obj_t * obj); +void _lv_event_mark_deleted(lv_obj_t * obj); /** @@ -213,7 +213,7 @@ void _lv_event_mark_deleted(struct _lv_obj_t * obj); * @param user_data custom data data will be available in `event_cb` * @return a pointer the event descriptor. Can be used in ::lv_obj_remove_event_dsc */ -struct _lv_event_dsc_t * lv_obj_add_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); +struct _lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); /** * Remove an event handler function for an object. @@ -221,7 +221,7 @@ struct _lv_event_dsc_t * lv_obj_add_event_cb(struct _lv_obj_t * obj, lv_event_cb * @param event_cb the event function to remove * @return true if any event handlers were removed */ -bool lv_obj_remove_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb); +bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb); /** * Remove an event handler function for an object. @@ -229,7 +229,7 @@ bool lv_obj_remove_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb); * @param event_dsc pointer to an event descriptor to remove (returned by ::lv_obj_add_event_cb) * @return true if any event handlers were removed */ -bool lv_obj_remove_event_dsc(struct _lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc); +bool lv_obj_remove_event_dsc(lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc); /** * Get the input device passed as parameter to indev related events. diff --git a/src/core/lv_group.h b/src/core/lv_group.h index c1a29f72a..ab2c553ed 100644 --- a/src/core/lv_group.h +++ b/src/core/lv_group.h @@ -49,8 +49,11 @@ typedef uint8_t lv_key_t; struct _lv_obj_t; struct _lv_group_t; -typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *); +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_group_t lv_group_t; +typedef struct _lv_obj_t lv_obj_t; +typedef void (*lv_group_focus_cb_t)(lv_group_t *); /** * Groups can be used to logically hold objects so that they can be individually focused. @@ -58,7 +61,7 @@ typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *); */ typedef struct _lv_group_t { lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ - struct _lv_obj_t ** obj_focus; /**< The object in focus*/ + lv_obj_t ** obj_focus; /**< The object in focus*/ lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ #if LV_USE_USER_DATA @@ -73,8 +76,6 @@ typedef struct _lv_group_t { of list.*/ } _lv_group_t; -/*Trick to no expose the fields of the struct in the MicroPython binding*/ -typedef _lv_group_t lv_group_t; typedef enum { LV_GROUP_REFOCUS_POLICY_NEXT = 0, @@ -120,13 +121,13 @@ lv_group_t * lv_group_get_default(void); * @param group pointer to a group * @param obj pointer to an object to add */ -void lv_group_add_obj(lv_group_t * group, struct _lv_obj_t * obj); +void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj); /** * Remove an object from its group * @param obj pointer to an object to remove */ -void lv_group_remove_obj(struct _lv_obj_t * obj); +void lv_group_remove_obj(lv_obj_t * obj); /** * Remove all objects from a group @@ -138,7 +139,7 @@ void lv_group_remove_all_objs(lv_group_t * group); * Focus on an object (defocus the current) * @param obj pointer to an object to focus on */ -void lv_group_focus_obj(struct _lv_obj_t * obj); +void lv_group_focus_obj(lv_obj_t * obj); /** * Focus the next object in a group (defocus the current) @@ -201,7 +202,7 @@ void lv_group_set_wrap(lv_group_t * group, bool en); * @param group pointer to a group * @return pointer to the focused object */ -struct _lv_obj_t * lv_group_get_focused(const lv_group_t * group); +lv_obj_t * lv_group_get_focused(const lv_group_t * group); /** * Get the focus callback function of a group diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index d75bd7593..96dc94cec 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -33,6 +33,8 @@ extern "C" { **********************/ struct _lv_obj_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; /** * Possible states of a widget. @@ -137,7 +139,7 @@ extern const lv_obj_class_t lv_obj_class; * They are allocated automatically if any elements is set. */ typedef struct { - struct _lv_obj_t ** children; /**< Store the pointer of the children in an array.*/ + lv_obj_t ** children; /**< Store the pointer of the children in an array.*/ uint32_t child_cnt; /**< Number of children*/ lv_group_t * group_p; @@ -156,7 +158,7 @@ typedef struct { typedef struct _lv_obj_t { const lv_obj_class_t * class_p; - struct _lv_obj_t * parent; + lv_obj_t * parent; _lv_obj_spec_attr_t * spec_attr; _lv_obj_style_t * styles; #if LV_USE_USER_DATA @@ -173,8 +175,7 @@ typedef struct _lv_obj_t { uint16_t w_layout :1; }_lv_obj_t; -/*Trick to no expose the fields of the struct in the MicroPython binding*/ -typedef _lv_obj_t lv_obj_t; + /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/core/lv_obj_class.c b/src/core/lv_obj_class.c index df090efa7..cd39d1f1a 100644 --- a/src/core/lv_obj_class.c +++ b/src/core/lv_obj_class.c @@ -140,7 +140,7 @@ void _lv_obj_destructor(lv_obj_t * obj) } } -bool lv_obj_is_editable(struct _lv_obj_t * obj) +bool lv_obj_is_editable(lv_obj_t * obj) { const lv_obj_class_t * class_p = obj->class_p; @@ -152,7 +152,7 @@ bool lv_obj_is_editable(struct _lv_obj_t * obj) return class_p->editable == LV_OBJ_CLASS_EDITABLE_TRUE ? true : false; } -bool lv_obj_is_group_def(struct _lv_obj_t * obj) +bool lv_obj_is_group_def(lv_obj_t * obj) { const lv_obj_class_t * class_p = obj->class_p; diff --git a/src/core/lv_obj_class.h b/src/core/lv_obj_class.h index 3b51e4d7a..c093e1aee 100644 --- a/src/core/lv_obj_class.h +++ b/src/core/lv_obj_class.h @@ -29,6 +29,11 @@ struct _lv_obj_t; struct _lv_obj_class_t; struct _lv_event_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_class_t lv_obj_class_t; +typedef struct _lv_event_t lv_event_t; +typedef struct _lv_obj_t lv_obj_t; + typedef enum { LV_OBJ_CLASS_EDITABLE_INHERIT, /**< Check the base class. Must have 0 value to let zero initialized class inherit*/ LV_OBJ_CLASS_EDITABLE_TRUE, @@ -42,19 +47,20 @@ typedef enum { }lv_obj_class_group_def_t; -typedef void (*lv_obj_class_event_cb_t)(struct _lv_obj_class_t * class_p, struct _lv_event_t * e); + +typedef void (*lv_obj_class_event_cb_t)(lv_obj_class_t * class_p, lv_event_t * e); /** * Describe the common methods of every object. * Similar to a C++ class. */ typedef struct _lv_obj_class_t { const struct _lv_obj_class_t * base_class; - void (*constructor_cb)(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * obj); - void (*destructor_cb)(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * obj); + void (*constructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj); + void (*destructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj); #if LV_USE_USER_DATA void * user_data; #endif - void (*event_cb)(const struct _lv_obj_class_t * class_p, struct _lv_event_t * e); /**< Widget type specific event function*/ + void (*event_cb)(const lv_obj_class_t * class_p, lv_event_t * e); /**< Widget type specific event function*/ lv_coord_t width_def; lv_coord_t height_def; uint32_t editable : 2; /**< Value from ::lv_obj_class_editable_t*/ @@ -72,15 +78,15 @@ typedef struct _lv_obj_class_t { * @param parent pointer to an object where the new object should be created * @return pointer to the created object */ -struct _lv_obj_t * lv_obj_class_create_obj(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent); +lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * parent); -void lv_obj_class_init_obj(struct _lv_obj_t * obj); +void lv_obj_class_init_obj(lv_obj_t * obj); -void _lv_obj_destructor(struct _lv_obj_t * obj); +void _lv_obj_destructor(lv_obj_t * obj); -bool lv_obj_is_editable(struct _lv_obj_t * obj); +bool lv_obj_is_editable(lv_obj_t * obj); -bool lv_obj_is_group_def(struct _lv_obj_t * obj); +bool lv_obj_is_group_def(lv_obj_t * obj); /********************** * MACROS diff --git a/src/core/lv_obj_draw.h b/src/core/lv_obj_draw.h index 4858195e8..59fd05bd4 100644 --- a/src/core/lv_obj_draw.h +++ b/src/core/lv_obj_draw.h @@ -24,6 +24,8 @@ extern "C" { **********************/ struct _lv_obj_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; /** Cover check results.*/ typedef enum { @@ -65,7 +67,7 @@ typedef struct * @note Only the relevant fields will be set. * E.g. if `border width == 0` the other border properties won't be evaluated. */ -void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc); +void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc); /** * Initialize a label draw descriptor from an object's styles in its current state @@ -75,7 +77,7 @@ void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_re * If the `opa` filed is set to or the property is equal to `LV_OPA_TRANSP` the rest won't be initialized. * Should be initialized with `lv_draw_label_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc); +void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc); /** * Initialize an image draw descriptor from an object's styles in its current state @@ -84,7 +86,7 @@ void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_l * @param draw_dsc the descriptor the initialize. * Should be initialized with `lv_draw_image_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc); +void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc); /** @@ -94,7 +96,7 @@ void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_img * @param draw_dsc the descriptor the initialize. * Should be initialized with `lv_draw_line_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc); +void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc); /** * Initialize an arc draw descriptor from an object's styles in its current state @@ -103,7 +105,7 @@ void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_li * @param draw_dsc the descriptor the initialize. * Should be initialized with `lv_draw_arc_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc); +void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc); /** * Get the required extra size (around the object's part) to draw shadow, outline, value etc. @@ -111,7 +113,7 @@ void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_arc * @param part part of the object * @return the extra size required around the object */ -lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part); +lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part); /** * Initialize a draw descriptor used in events. @@ -125,14 +127,14 @@ void lv_obj_draw_dsc_init(lv_obj_draw_part_dsc_t * dsc, const lv_area_t * clip_a * The result will be saved in `obj`. * @param obj pointer to an object */ -void lv_obj_refresh_ext_draw_size(struct _lv_obj_t * obj); +void lv_obj_refresh_ext_draw_size(lv_obj_t * obj); /** * Get the extended draw area of an object. * @param obj pointer to an object * @return the size extended draw area around the real coordinates */ -lv_coord_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj); +lv_coord_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj); /********************** * MACROS diff --git a/src/core/lv_obj_pos.c b/src/core/lv_obj_pos.c index a80f36509..34925d503 100644 --- a/src/core/lv_obj_pos.c +++ b/src/core/lv_obj_pos.c @@ -347,7 +347,7 @@ uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data) return layout_cnt; /*No -1 to skip 0th index*/ } -void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align) +void lv_obj_set_align(lv_obj_t * obj, lv_align_t align) { lv_obj_set_style_align(obj, align, 0); } diff --git a/src/core/lv_obj_pos.h b/src/core/lv_obj_pos.h index ab2acb7f5..e1dbb39fa 100644 --- a/src/core/lv_obj_pos.h +++ b/src/core/lv_obj_pos.h @@ -23,7 +23,10 @@ extern "C" { * TYPEDEFS **********************/ struct _lv_obj_t; -typedef void (*lv_layout_update_cb_t)(struct _lv_obj_t *, void * user_data); +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; + +typedef void (*lv_layout_update_cb_t)(lv_obj_t *, void * user_data); typedef struct { lv_layout_update_cb_t cb; void * user_data; @@ -39,21 +42,21 @@ typedef struct { * @param x new distance from the left side of the parent plus the parent's left padding * @param y new distance from the top side of the parent plus the parent's right padding */ -void lv_obj_set_pos(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y); +void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y); /** * Set the x coordinate of a object * @param obj pointer to an object * @param x new distance from the left side from the parent plus the parent's left padding */ -void lv_obj_set_x(struct _lv_obj_t * obj, lv_coord_t x); +void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x); /** * Set the y coordinate of a object * @param obj pointer to an object * @param y new distance from the top of the parent plus the parent's top padding */ -void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y); +void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y); /** * Set the size of an object. @@ -66,14 +69,14 @@ void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y); * LV_SIZE_PCT(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_size(struct _lv_obj_t * obj, lv_coord_t w, lv_coord_t h); +void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h); /** * Recalculate the size of the object * @param obj pointer to an object * @return true: the size has been changed */ -bool lv_obj_refr_size(struct _lv_obj_t * obj); +bool lv_obj_refr_size(lv_obj_t * obj); /** * Set the width of an object @@ -85,7 +88,7 @@ bool lv_obj_refr_size(struct _lv_obj_t * obj); * lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w); +void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w); /** * Set the height of an object @@ -97,47 +100,47 @@ void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w); * lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_height(struct _lv_obj_t * obj, lv_coord_t h); +void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h); /** * Set the width reduced by the left and right padding and the border width. * @param obj pointer to an object * @param w the width without paddings in pixels */ -void lv_obj_set_content_width(struct _lv_obj_t * obj, lv_coord_t w); +void lv_obj_set_content_width(lv_obj_t * obj, lv_coord_t w); /** * Set the height reduced by the top and bottom padding and the border width. * @param obj pointer to an object * @param h the height without paddings in pixels */ -void lv_obj_set_content_height(struct _lv_obj_t * obj, lv_coord_t h); +void lv_obj_set_content_height(lv_obj_t * obj, lv_coord_t h); /** * Set a layout for an object * @param obj pointer to an object * @param layout pointer to a layout descriptor to set */ -void lv_obj_set_layout(struct _lv_obj_t * obj, uint32_t layout); +void lv_obj_set_layout(lv_obj_t * obj, uint32_t layout); /** * Test whether the and object is positioned by a layout or not * @param obj pointer to an object to test * @return true: positioned by a layout; false: not positioned by a layout */ -bool lv_obj_is_layout_positioned(const struct _lv_obj_t * obj); +bool lv_obj_is_layout_positioned(const lv_obj_t * obj); /** * Mark the object for layout update. * @param obj pointer to an object whose children needs to be updated */ -void lv_obj_mark_layout_as_dirty(struct _lv_obj_t * obj); +void lv_obj_mark_layout_as_dirty(lv_obj_t * obj); /** * Update the layout of an object. * @param obj pointer to an object whose children needs to be updated */ -void lv_obj_update_layout(const struct _lv_obj_t * obj); +void lv_obj_update_layout(const lv_obj_t * obj); /** * Regsiter a new layout @@ -152,7 +155,7 @@ uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data); * @param obj pointer to an object to align * @param align type of alignment (see 'lv_align_t' enum) `LV_ALIGN_OUT_...` can't be used. */ -void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align); +void lv_obj_set_align(lv_obj_t * obj, lv_align_t align); /** * Change the alignment of an object and set new coordinates. @@ -164,7 +167,7 @@ void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align); * @param x_ofs x coordinate offset after alignment * @param y_ofs y coordinate offset after alignment */ -void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); +void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); /** * Align an object to an other object. @@ -175,14 +178,14 @@ void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv * @param y_ofs y coordinate offset after alignment * @note if the position or size of `base` changes `obj` needs to be aligned manually again */ -void lv_obj_align_to(struct _lv_obj_t * obj, const struct _lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); +void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); /** * Align an object to the center on its parent. * @param obj pointer to an object to align * @note if the parent size changes `obj` needs to be aligned manually again */ -static inline void lv_obj_center(struct _lv_obj_t * obj) +static inline void lv_obj_center(lv_obj_t * obj) { lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0); } @@ -193,7 +196,7 @@ static inline void lv_obj_center(struct _lv_obj_t * obj) * @param obj pointer to an object * @param coords pointer to an area to store the coordinates */ -void lv_obj_get_coords(const struct _lv_obj_t * obj, lv_area_t * coords); +void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords); /** * Get the x coordinate of object. @@ -203,7 +206,7 @@ void lv_obj_get_coords(const struct _lv_obj_t * obj, lv_area_t * coords); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_x(const lv_obj_t * obj); /** * Get the x2 coordinate of object. @@ -213,7 +216,7 @@ lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_x2(const lv_obj_t * obj); /** * Get the y coordinate of object. @@ -223,7 +226,7 @@ lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_y(const lv_obj_t * obj); /** * Get the y2 coordinate of object. @@ -233,42 +236,42 @@ lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -lv_coord_t lv_obj_get_y2(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_y2(const lv_obj_t * obj); /** * Get the width of an object * @param obj pointer to an object * @return the width in pixels */ -lv_coord_t lv_obj_get_width(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_width(const lv_obj_t * obj); /** * Get the height of an object * @param obj pointer to an object * @return the height in pixels */ -lv_coord_t lv_obj_get_height(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_height(const lv_obj_t * obj); /** * Get the width reduced by the left and right padding and the border width. * @param obj pointer to an object * @return the width which still fits into its parent without causing overflow (making the parent scrollable) */ -lv_coord_t lv_obj_get_content_width(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_content_width(const lv_obj_t * obj); /** * Get the height reduced by the top an bottom padding and the border width. * @param obj pointer to an object * @return the height which still fits into the parent without causing overflow (making the parent scrollable) */ -lv_coord_t lv_obj_get_content_height(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_content_height(const lv_obj_t * obj); /** * Get the area reduced by the paddings and the border width. * @param obj pointer to an object * @param area the area which still fits into the parent without causing overflow (making the parent scrollable) */ -void lv_obj_get_content_coords(const struct _lv_obj_t * obj, lv_area_t * area); +void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area); /** * Get the width occupied by the "parts" of the widget. E.g. the width of all columns of a table. @@ -277,7 +280,7 @@ void lv_obj_get_content_coords(const struct _lv_obj_t * obj, lv_area_t * area); * @note This size independent from the real size of the widget. * It just tells how large the internal ("virtual") content is. */ -lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_self_width(const lv_obj_t * obj); /** * Get the height occupied by the "parts" of the widget. E.g. the height of all rows of a table. @@ -286,21 +289,21 @@ lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj); * @note This size independent from the real size of the widget. * It just tells how large the internal ("virtual") content is. */ -lv_coord_t lv_obj_get_self_height(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj); /** * Handle if the size of the internal ("virtual") content of an object has changed. * @param obj pointer to an object * @return false: nothing happened; true: refresh happened */ -bool lv_obj_refresh_self_size(struct _lv_obj_t * obj); +bool lv_obj_refresh_self_size(lv_obj_t * obj); -void lv_obj_refr_pos(struct _lv_obj_t * obj); +void lv_obj_refr_pos(lv_obj_t * obj); -void lv_obj_move_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y); +void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y); -void lv_obj_move_children_by(struct _lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating); +void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating); /** * Mark an area of an object as invalid. @@ -308,13 +311,13 @@ void lv_obj_move_children_by(struct _lv_obj_t * obj, lv_coord_t x_diff, lv_coord * @param obj pointer to an object * @param area the area to redraw */ -void lv_obj_invalidate_area(const struct _lv_obj_t * obj, const lv_area_t * area); +void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area); /** * Mark the object as invalid to redrawn its area * @param obj pointer to an object */ -void lv_obj_invalidate(const struct _lv_obj_t * obj); +void lv_obj_invalidate(const lv_obj_t * obj); /** * Tell whether an area of an object is visible (even partially) now or not @@ -322,21 +325,21 @@ void lv_obj_invalidate(const struct _lv_obj_t * obj); * @param area the are to check. The visible part of the area will be written back here. * @return true visible; false not visible (hidden, out of parent, on other screen, etc) */ -bool lv_obj_area_is_visible(const struct _lv_obj_t * obj, lv_area_t * area); +bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area); /** * Tell whether an object is visible (even partially) now or not * @param obj pointer to an object * @return true: visible; false not visible (hidden, out of parent, on other screen, etc) */ -bool lv_obj_is_visible(const struct _lv_obj_t * obj); +bool lv_obj_is_visible(const lv_obj_t * obj); /** * Set the size of an extended clickable area * @param obj pointer to an object * @param size extended clickable area in all 4 directions [px] */ -void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, lv_coord_t size); +void lv_obj_set_ext_click_area(lv_obj_t * obj, lv_coord_t size); /** * Get the an area where to object can be clicked. @@ -344,7 +347,7 @@ void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, lv_coord_t size); * @param obj pointer to an object * @param area store the result area here */ -void lv_obj_get_click_area(const struct _lv_obj_t * obj, lv_area_t * area); +void lv_obj_get_click_area(const lv_obj_t * obj, lv_area_t * area); /** * Hit-test an object given a particular point in screen space. @@ -352,7 +355,7 @@ void lv_obj_get_click_area(const struct _lv_obj_t * obj, lv_area_t * area); * @param point screen-space point (absolute coordinate) * @return true: if the object is considered under the point */ -bool lv_obj_hit_test(struct _lv_obj_t * obj, const lv_point_t * point); +bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point); /** * Clamp a width between min and max width. If the min/max width is in percentage value use the ref_width diff --git a/src/core/lv_obj_scroll.c b/src/core/lv_obj_scroll.c index 42226ecc1..d3c0222ff 100644 --- a/src/core/lv_obj_scroll.c +++ b/src/core/lv_obj_scroll.c @@ -64,7 +64,7 @@ void lv_obj_set_scrollbar_mode(lv_obj_t * obj, lv_scrollbar_mode_t mode) lv_obj_invalidate(obj); } -void lv_obj_set_scroll_dir(struct _lv_obj_t * obj, lv_dir_t dir) +void lv_obj_set_scroll_dir(lv_obj_t * obj, lv_dir_t dir) { lv_obj_allocate_spec_attr(obj); @@ -73,13 +73,13 @@ void lv_obj_set_scroll_dir(struct _lv_obj_t * obj, lv_dir_t dir) } } -void lv_obj_set_scroll_snap_x(struct _lv_obj_t * obj, lv_scroll_snap_t align) +void lv_obj_set_scroll_snap_x(lv_obj_t * obj, lv_scroll_snap_t align) { lv_obj_allocate_spec_attr(obj); obj->spec_attr->scroll_snap_x = align; } -void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align) +void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align) { lv_obj_allocate_spec_attr(obj); obj->spec_attr->scroll_snap_y = align; @@ -89,25 +89,25 @@ void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align) * Getter functions *====================*/ -lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const struct _lv_obj_t * obj) +lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj) { if(obj->spec_attr) return obj->spec_attr->scrollbar_mode; else return LV_SCROLLBAR_MODE_AUTO; } -lv_dir_t lv_obj_get_scroll_dir(const struct _lv_obj_t * obj) +lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj) { if(obj->spec_attr) return obj->spec_attr->scroll_dir; else return LV_DIR_ALL; } -lv_scroll_snap_t lv_obj_get_scroll_snap_x(const struct _lv_obj_t * obj) +lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj) { if(obj->spec_attr) return obj->spec_attr->scroll_snap_x; else return LV_SCROLL_SNAP_NONE; } -lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj) +lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj) { if(obj->spec_attr) return obj->spec_attr->scroll_snap_y; else return LV_SCROLL_SNAP_NONE; diff --git a/src/core/lv_obj_scroll.h b/src/core/lv_obj_scroll.h index 2cfa76ac9..b39fcf0af 100644 --- a/src/core/lv_obj_scroll.h +++ b/src/core/lv_obj_scroll.h @@ -27,6 +27,9 @@ extern "C" { /*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; + /** Scrollbar modes: shows when should the scrollbars be visible*/ enum { LV_SCROLLBAR_MODE_OFF, /**< Never show scrollbars*/ @@ -59,28 +62,28 @@ typedef uint8_t lv_scroll_snap_t; * @param obj pointer to an object * @param mode LV_SCROLL_MODE_ON/OFF/AUTO/ACTIVE */ -void lv_obj_set_scrollbar_mode(struct _lv_obj_t * obj, lv_scrollbar_mode_t mode); +void lv_obj_set_scrollbar_mode(lv_obj_t * obj, lv_scrollbar_mode_t mode); /** * Set the object in which directions can be scrolled * @param obj pointer to an object * @param dir the allow scroll directions. An element or OR-ed values of `lv_dir_t` */ -void lv_obj_set_scroll_dir(struct _lv_obj_t * obj, lv_dir_t dir); +void lv_obj_set_scroll_dir(lv_obj_t * obj, lv_dir_t dir); /** * Set where to snap the children when scrolling ends horizontally * @param obj pointer to an object * @param align the snap align to set from `lv_snap_align_t` */ -void lv_obj_set_scroll_snap_x(struct _lv_obj_t * obj, lv_scroll_snap_t align); +void lv_obj_set_scroll_snap_x(lv_obj_t * obj, lv_scroll_snap_t align); /** * Set where to snap the children when scrolling ends vertically * @param obj pointer to an object * @param align the snap align to set from `lv_snap_align_t` */ -void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align); +void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align); /*===================== * Getter functions @@ -91,28 +94,28 @@ void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align); * @param obj pointer to an object * @return the current scroll mode from `lv_scroll_mode_t` */ -lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const struct _lv_obj_t * obj); +lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj); /** * Get the object in which directions can be scrolled * @param obj pointer to an object * @param dir the allow scroll directions. An element or OR-ed values of `lv_dir_t` */ -lv_dir_t lv_obj_get_scroll_dir(const struct _lv_obj_t * obj); +lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj); /** * Get where to snap the children when scrolling ends horizontally * @param obj pointer to an object * @return the current snap align from `lv_snap_align_t` */ -lv_scroll_snap_t lv_obj_get_scroll_snap_x(const struct _lv_obj_t * obj); +lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj); /** * Get where to snap the children when scrolling ends vertically * @param obj pointer to an object * @return the current snap align from `lv_snap_align_t` */ -lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj); +lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj); /** * Get current X scroll position. @@ -122,7 +125,7 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj); * If scrolled return > 0 * If scrolled in (elastic scroll) return < 0 */ -lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_x(const lv_obj_t * obj); /** * Get current Y scroll position. @@ -132,7 +135,7 @@ lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj); * If scrolled return > 0 * If scrolled inside return < 0 */ -lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_y(const lv_obj_t * obj); /** * Return the height of the area above the object. @@ -141,7 +144,7 @@ lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area above the object in pixels */ -lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_top(lv_obj_t * obj); /** * Return the height of the area below the object. @@ -150,7 +153,7 @@ lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area below the object in pixels */ -lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_bottom(lv_obj_t * obj); /** * Return the width of the area on the left the object. @@ -159,7 +162,7 @@ lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area on the left the object in pixels */ -lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj); /** * Return the width of the area on the right the object. @@ -168,7 +171,7 @@ lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area on the right the object in pixels */ -lv_coord_t lv_obj_get_scroll_right(struct _lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj); /** * Get the X and Y coordinates where the scrolling will end for this object if a scrolling animation is in progress. @@ -192,7 +195,7 @@ void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end); * @note > 0 value means scroll right/bottom (show the more content on the right/bottom) * @note */ -void lv_obj_scroll_by(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll to a given coordinate on an object. @@ -202,7 +205,7 @@ void lv_obj_scroll_by(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_ani * @param y pixels to scroll vertically * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll to a given X coordinate on an object. @@ -211,7 +214,7 @@ void lv_obj_scroll_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_ani * @param x pixels to scroll horizontally * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en); /** * Scroll to a given Y coordinate on an object @@ -220,14 +223,14 @@ void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t a * @param y pixels to scroll vertically * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_y(struct _lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_y(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll to an object until it becomes visible on its parent * @param obj pointer to an object to scroll into view * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en); /** * Scroll to an object until it becomes visible on its parent. @@ -236,21 +239,21 @@ void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); * @param obj pointer to an object to scroll into view * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en); /** * Tell whether an object is being scrolled or not at this moment * @param obj pointer to an object * @return true: `obj` is being scrolled */ -bool lv_obj_is_scrolling(const struct _lv_obj_t * obj); +bool lv_obj_is_scrolling(const lv_obj_t * obj); /** * Check the children of `obj` and scroll `obj` to fulfill the scroll_snap settings * @param obj an object whose children needs to checked and snapped * @param anim_en LV_ANIM_ON/OFF */ -void lv_obj_update_snap(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en); /** * Get the area of the scrollbars @@ -258,13 +261,13 @@ void lv_obj_update_snap(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); * @param hor_area pointer to store the area of the horizontal scrollbar * @param ver_area pointer to store the area of the vertical scrollbar */ -void lv_obj_get_scrollbar_area(struct _lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver); +void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver); /** * Invalidate the area of the scrollbars * @param obj pointer to an object */ -void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj); +void lv_obj_scrollbar_invalidate(lv_obj_t * obj); /********************** * MACROS diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c index 542d4c6af..dde2742c4 100644 --- a/src/core/lv_obj_style.c +++ b/src/core/lv_obj_style.c @@ -73,7 +73,7 @@ void _lv_obj_style_init(void) _lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(trans_t)); } -void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector) +void lv_obj_add_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector) { trans_del(obj, selector, LV_STYLE_PROP_ANY, NULL); diff --git a/src/core/lv_obj_style.h b/src/core/lv_obj_style.h index f6d30507e..57df464a1 100644 --- a/src/core/lv_obj_style.h +++ b/src/core/lv_obj_style.h @@ -27,6 +27,9 @@ extern "C" { /*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; + typedef enum { _LV_STYLE_STATE_CMP_SAME, /*The style properties in the 2 states are identical*/ _LV_STYLE_STATE_CMP_DIFF_REDRAW, /*The differences can be shown with a simple redraw*/ @@ -72,7 +75,7 @@ void _lv_obj_style_init(void); * @param style pointer to a style to add * @example lv_obj_add_style_no_refresh(slider, LV_PART_KNOB, LV_STATE_PRESSED, &style1); */ -void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); +void lv_obj_add_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); /** * Add a style to an object. @@ -83,13 +86,13 @@ void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selec * @example lv_obj_remove_style(obj, LV_PART_MAIN, LV_STATE_ANY, &style); //Remove all styles from the main part * @example lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL); //Remove all styles */ -void lv_obj_remove_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); +void lv_obj_remove_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); /** * Remove all styles from an object * @param obj pointer to an object */ -static inline void lv_obj_remove_style_all(struct _lv_obj_t * obj) +static inline void lv_obj_remove_style_all(lv_obj_t * obj) { lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); } @@ -109,7 +112,7 @@ void lv_obj_report_style_change(lv_style_t * style); * It is used to optimize what needs to be refreshed. * `LV_STYLE_PROP_INV` to perform only a style cache update */ -void lv_obj_refresh_style(struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); +void lv_obj_refresh_style(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); /** * Enable or disable automatic style refreshing when a new style is added/removed to/from an object @@ -128,7 +131,7 @@ void lv_obj_enable_style_refresh(bool en); * @return the value of the property. * Should be read from the correct field of the `lv_style_value_t` according to the type of the property. */ -lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); +lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); /** * Set local style property on an object's part and state. @@ -138,9 +141,9 @@ lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, lv_part_t p * @param prop the property * @param value value of the property. The correct element should be set according to the type of the property */ -void lv_obj_set_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector); +void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector); -lv_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector); +lv_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector); /** * Remove a local style property from a part of an object with a given state. @@ -150,7 +153,7 @@ lv_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t pro * @param prop a style property to remove. * @return true the property was found and removed; false: the property was not found */ -bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector); +bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector); /** * Used internally to create a style tarnsition @@ -160,7 +163,7 @@ bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop * @param new_state * @param tr */ -void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state, const _lv_obj_style_transition_dsc_t * tr); +void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state, const _lv_obj_style_transition_dsc_t * tr); /** * Used internally to compare the appearance of an object in 2 states @@ -169,7 +172,7 @@ void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_part_t part, lv_ * @param state2 * @return */ -_lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_state_t state1, lv_state_t state2); +_lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2); /** * Fade in an an object and all its children. @@ -177,7 +180,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_sta * @param time time of fade * @param delay delay to start the animation */ -void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay); +void lv_obj_fade_in(lv_obj_t * obj, uint32_t time, uint32_t delay); /** * Fade out an an object and all its children. @@ -185,7 +188,7 @@ void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay); * @param time time of fade * @param delay delay to start the animation */ -void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay); +void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay); lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector); @@ -193,29 +196,29 @@ lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector); #include "lv_obj_style_gen.h" -static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { +static inline void lv_obj_set_style_pad_all(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_left(obj, value, selector); lv_obj_set_style_pad_right(obj, value, selector); lv_obj_set_style_pad_top(obj, value, selector); lv_obj_set_style_pad_bottom(obj, value, selector); } -static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { +static inline void lv_obj_set_style_pad_hor(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_left(obj, value, selector); lv_obj_set_style_pad_right(obj, value, selector); } -static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { +static inline void lv_obj_set_style_pad_ver(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_top(obj, value, selector); lv_obj_set_style_pad_bottom(obj, value, selector); } -static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { +static inline void lv_obj_set_style_pad_gap(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_row(obj, value, selector); lv_obj_set_style_pad_column(obj, value, selector); } -static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { +static inline void lv_obj_set_style_size(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_width(obj, value, selector); lv_obj_set_style_height(obj, value, selector); } diff --git a/src/core/lv_obj_style_gen.h b/src/core/lv_obj_style_gen.h index 557cb538c..283d6f55e 100644 --- a/src/core/lv_obj_style_gen.h +++ b/src/core/lv_obj_style_gen.h @@ -1,538 +1,538 @@ -static inline lv_coord_t lv_obj_get_style_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_min_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_min_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_max_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_max_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_height(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_height(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_HEIGHT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_min_height(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_min_height(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_HEIGHT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_max_height(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_max_height(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_HEIGHT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_x(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_x(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_X); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_y(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_y(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_Y); return (lv_coord_t)v.num; } -static inline lv_align_t lv_obj_get_style_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_align_t lv_obj_get_style_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ALIGN); return (lv_align_t)v.num; } -static inline lv_coord_t lv_obj_get_style_transform_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_transform_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_transform_height(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_transform_height(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_HEIGHT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_translate_x(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_translate_x(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_X); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_translate_y(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_translate_y(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_Y); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_transform_zoom(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_transform_zoom(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ZOOM); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_transform_angle(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_transform_angle(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ANGLE); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_top(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_TOP); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_bottom(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_BOTTOM); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_left(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_LEFT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_right(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RIGHT); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_row(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_ROW); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_pad_column(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_COLUMN); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_radius(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_radius(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS); return (lv_coord_t)v.num; } -static inline bool lv_obj_get_style_clip_corner(const struct _lv_obj_t * obj, uint32_t part) +static inline bool lv_obj_get_style_clip_corner(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CLIP_CORNER); return (bool)v.num; } -static inline lv_opa_t lv_obj_get_style_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA); return (lv_opa_t)v.num; } -static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part) +static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC); return (const lv_color_filter_dsc_t *)v.ptr; } -static inline lv_opa_t lv_obj_get_style_color_filter_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_color_filter_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_OPA); return (lv_opa_t)v.num; } -static inline uint32_t lv_obj_get_style_anim_time(const struct _lv_obj_t * obj, uint32_t part) +static inline uint32_t lv_obj_get_style_anim_time(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_TIME); return (uint32_t)v.num; } -static inline uint32_t lv_obj_get_style_anim_speed(const struct _lv_obj_t * obj, uint32_t part) +static inline uint32_t lv_obj_get_style_anim_speed(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_SPEED); return (uint32_t)v.num; } -static inline const lv_style_transition_dsc_t * lv_obj_get_style_transition(const struct _lv_obj_t * obj, uint32_t part) +static inline const lv_style_transition_dsc_t * lv_obj_get_style_transition(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSITION); return (const lv_style_transition_dsc_t *)v.ptr; } -static inline lv_blend_mode_t lv_obj_get_style_blend_mode(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_blend_mode_t lv_obj_get_style_blend_mode(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BLEND_MODE); return (lv_blend_mode_t)v.num; } -static inline uint16_t lv_obj_get_style_layout(const struct _lv_obj_t * obj, uint32_t part) +static inline uint16_t lv_obj_get_style_layout(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LAYOUT); return (uint16_t)v.num; } -static inline lv_base_dir_t lv_obj_get_style_base_dir(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_base_dir_t lv_obj_get_style_base_dir(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BASE_DIR); return (lv_base_dir_t)v.num; } -static inline lv_color_t lv_obj_get_style_bg_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_bg_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_bg_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_grad_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR_FILTERED); return v.color; } -static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_DIR); return (lv_grad_dir_t)v.num; } -static inline lv_coord_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_bg_main_stop(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_STOP); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_STOP); return (lv_coord_t)v.num; } -static inline const void * lv_obj_get_style_bg_img_src(const struct _lv_obj_t * obj, uint32_t part) +static inline const void * lv_obj_get_style_bg_img_src(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_SRC); return (const void *)v.ptr; } -static inline lv_opa_t lv_obj_get_style_bg_img_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_bg_img_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_bg_img_recolor(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_img_recolor(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_bg_img_recolor_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_bg_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_bg_img_recolor_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR_OPA); return (lv_opa_t)v.num; } -static inline bool lv_obj_get_style_bg_img_tiled(const struct _lv_obj_t * obj, uint32_t part) +static inline bool lv_obj_get_style_bg_img_tiled(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_TILED); return (bool)v.num; } -static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_border_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_border_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_border_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_border_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_OPA); return (lv_opa_t)v.num; } -static inline lv_coord_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_border_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_WIDTH); return (lv_coord_t)v.num; } -static inline lv_border_side_t lv_obj_get_style_border_side(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_border_side_t lv_obj_get_style_border_side(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_SIDE); return (lv_border_side_t)v.num; } -static inline bool lv_obj_get_style_border_post(const struct _lv_obj_t * obj, uint32_t part) +static inline bool lv_obj_get_style_border_post(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_POST); return (bool)v.num; } -static inline lv_color_t lv_obj_get_style_text_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_text_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_text_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_text_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_text_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_text_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OPA); return (lv_opa_t)v.num; } -static inline const lv_font_t * lv_obj_get_style_text_font(const struct _lv_obj_t * obj, uint32_t part) +static inline const lv_font_t * lv_obj_get_style_text_font(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_FONT); return (const lv_font_t *)v.ptr; } -static inline lv_coord_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_text_letter_space(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LETTER_SPACE); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_text_line_space(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LINE_SPACE); return (lv_coord_t)v.num; } -static inline lv_text_decor_t lv_obj_get_style_text_decor(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_text_decor_t lv_obj_get_style_text_decor(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_DECOR); return (lv_text_decor_t)v.num; } -static inline lv_text_align_t lv_obj_get_style_text_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_text_align_t lv_obj_get_style_text_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_ALIGN); return (lv_text_align_t)v.num; } -static inline lv_opa_t lv_obj_get_style_img_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_img_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_img_recolor(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_img_recolor(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_img_recolor_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_img_recolor_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_OPA); return (lv_opa_t)v.num; } -static inline lv_coord_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_outline_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_WIDTH); return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_outline_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_outline_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_outline_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_outline_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_OPA); return (lv_opa_t)v.num; } -static inline lv_coord_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_outline_pad(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_PAD); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_shadow_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_X); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_Y); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_shadow_spread(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_SPREAD); return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_shadow_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_shadow_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_shadow_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OPA); return (lv_opa_t)v.num; } -static inline lv_coord_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_line_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_line_dash_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_line_dash_gap(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_GAP); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_line_rounded(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_line_rounded(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_ROUNDED); return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_line_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_line_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_line_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_line_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_line_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_line_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_OPA); return (lv_opa_t)v.num; } -static inline lv_coord_t lv_obj_get_style_arc_width(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_arc_width(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_WIDTH); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_arc_rounded(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_arc_rounded(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_ROUNDED); return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_arc_color(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_arc_color(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_arc_color_filtered(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_color_t lv_obj_get_style_arc_color_filtered(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_COLOR_FILTERED); return v.color; } -static inline lv_opa_t lv_obj_get_style_arc_opa(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_opa_t lv_obj_get_style_arc_opa(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_OPA); return (lv_opa_t)v.num; } -static inline const void * lv_obj_get_style_arc_img_src(const struct _lv_obj_t * obj, uint32_t part) +static inline const void * lv_obj_get_style_arc_img_src(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_IMG_SRC); return (const void *)v.ptr; } -static inline void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -540,7 +540,7 @@ static inline void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t val lv_obj_set_local_style_prop(obj, LV_STYLE_WIDTH, v, selector); } -static inline void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_min_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -548,7 +548,7 @@ static inline void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_WIDTH, v, selector); } -static inline void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_max_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -556,7 +556,7 @@ static inline void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_WIDTH, v, selector); } -static inline void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_height(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -564,7 +564,7 @@ static inline void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t va lv_obj_set_local_style_prop(obj, LV_STYLE_HEIGHT, v, selector); } -static inline void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_min_height(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -572,7 +572,7 @@ static inline void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_ lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_HEIGHT, v, selector); } -static inline void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_max_height(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -580,7 +580,7 @@ static inline void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_ lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_HEIGHT, v, selector); } -static inline void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_x(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -588,7 +588,7 @@ static inline void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_obj_set_local_style_prop(obj, LV_STYLE_X, v, selector); } -static inline void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_y(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -596,7 +596,7 @@ static inline void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_obj_set_local_style_prop(obj, LV_STYLE_Y, v, selector); } -static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_align(lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -604,7 +604,7 @@ static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t val lv_obj_set_local_style_prop(obj, LV_STYLE_ALIGN, v, selector); } -static inline void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_transform_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -612,7 +612,7 @@ static inline void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_c lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_WIDTH, v, selector); } -static inline void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_transform_height(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -620,7 +620,7 @@ static inline void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_HEIGHT, v, selector); } -static inline void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_translate_x(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -628,7 +628,7 @@ static inline void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_X, v, selector); } -static inline void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_translate_y(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -636,7 +636,7 @@ static inline void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_Y, v, selector); } -static inline void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_transform_zoom(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -644,7 +644,7 @@ static inline void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_co lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ZOOM, v, selector); } -static inline void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_transform_angle(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -652,7 +652,7 @@ static inline void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_c lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ANGLE, v, selector); } -static inline void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_top(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -660,7 +660,7 @@ static inline void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t v lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_TOP, v, selector); } -static inline void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_bottom(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -668,7 +668,7 @@ static inline void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_ lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_BOTTOM, v, selector); } -static inline void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_left(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -676,7 +676,7 @@ static inline void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_LEFT, v, selector); } -static inline void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_right(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -684,7 +684,7 @@ static inline void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_RIGHT, v, selector); } -static inline void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_row(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -692,7 +692,7 @@ static inline void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t v lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_ROW, v, selector); } -static inline void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_column(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -700,7 +700,7 @@ static inline void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_ lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_COLUMN, v, selector); } -static inline void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_radius(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -708,7 +708,7 @@ static inline void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t va lv_obj_set_local_style_prop(obj, LV_STYLE_RADIUS, v, selector); } -static inline void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) +static inline void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -716,7 +716,7 @@ static inline void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool val lv_obj_set_local_style_prop(obj, LV_STYLE_CLIP_CORNER, v, selector); } -static inline void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -724,7 +724,7 @@ static inline void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector); } -static inline void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector) +static inline void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -732,7 +732,7 @@ static inline void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, con lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_DSC, v, selector); } -static inline void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -740,7 +740,7 @@ static inline void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_ lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_OPA, v, selector); } -static inline void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_anim_time(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -748,7 +748,7 @@ static inline void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t v lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_TIME, v, selector); } -static inline void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_anim_speed(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -756,7 +756,7 @@ static inline void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_SPEED, v, selector); } -static inline void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector) +static inline void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -764,7 +764,7 @@ static inline void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSITION, v, selector); } -static inline void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_blend_mode(lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -772,7 +772,7 @@ static inline void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_ lv_obj_set_local_style_prop(obj, LV_STYLE_BLEND_MODE, v, selector); } -static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -780,7 +780,7 @@ static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t valu lv_obj_set_local_style_prop(obj, LV_STYLE_LAYOUT, v, selector); } -static inline void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_base_dir(lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -788,7 +788,7 @@ static inline void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir lv_obj_set_local_style_prop(obj, LV_STYLE_BASE_DIR, v, selector); } -static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -796,7 +796,7 @@ static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t lv_obj_set_local_style_prop(obj, LV_STYLE_BG_COLOR, v, selector); } -static inline void lv_obj_set_style_bg_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -804,7 +804,7 @@ static inline void lv_obj_set_style_bg_color_filtered(struct _lv_obj_t * obj, lv lv_obj_set_local_style_prop(obj, LV_STYLE_BG_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -812,7 +812,7 @@ static inline void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t valu lv_obj_set_local_style_prop(obj, LV_STYLE_BG_OPA, v, selector); } -static inline void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_grad_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -820,7 +820,7 @@ static inline void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_col lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_COLOR, v, selector); } -static inline void lv_obj_set_style_bg_grad_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_grad_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -828,7 +828,7 @@ static inline void lv_obj_set_style_bg_grad_color_filtered(struct _lv_obj_t * ob lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_grad_dir(lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -836,7 +836,7 @@ static inline void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_ lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_DIR, v, selector); } -static inline void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_main_stop(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -844,7 +844,7 @@ static inline void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_STOP, v, selector); } -static inline void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_grad_stop(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -852,7 +852,7 @@ static inline void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_STOP, v, selector); } -static inline void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -860,7 +860,7 @@ static inline void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const voi lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_SRC, v, selector); } -static inline void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -868,7 +868,7 @@ static inline void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_OPA, v, selector); } -static inline void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -876,7 +876,7 @@ static inline void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_co lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR, v, selector); } -static inline void lv_obj_set_style_bg_img_recolor_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_recolor_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -884,7 +884,7 @@ static inline void lv_obj_set_style_bg_img_recolor_filtered(struct _lv_obj_t * o lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -892,7 +892,7 @@ static inline void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, l lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR_OPA, v, selector); } -static inline void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) +static inline void lv_obj_set_style_bg_img_tiled(lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -900,7 +900,7 @@ static inline void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool va lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_TILED, v, selector); } -static inline void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -908,7 +908,7 @@ static inline void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_colo lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_COLOR, v, selector); } -static inline void lv_obj_set_style_border_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -916,7 +916,7 @@ static inline void lv_obj_set_style_border_color_filtered(struct _lv_obj_t * obj lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -924,7 +924,7 @@ static inline void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_OPA, v, selector); } -static inline void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -932,7 +932,7 @@ static inline void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_WIDTH, v, selector); } -static inline void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_side(lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -940,7 +940,7 @@ static inline void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_borde lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_SIDE, v, selector); } -static inline void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) +static inline void lv_obj_set_style_border_post(lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -948,7 +948,7 @@ static inline void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool val lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_POST, v, selector); } -static inline void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -956,7 +956,7 @@ static inline void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_ lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_COLOR, v, selector); } -static inline void lv_obj_set_style_text_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -964,7 +964,7 @@ static inline void lv_obj_set_style_text_color_filtered(struct _lv_obj_t * obj, lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -972,7 +972,7 @@ static inline void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t va lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OPA, v, selector); } -static inline void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_font(lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -980,7 +980,7 @@ static inline void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_f lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_FONT, v, selector); } -static inline void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_letter_space(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -988,7 +988,7 @@ static inline void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LETTER_SPACE, v, selector); } -static inline void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_line_space(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -996,7 +996,7 @@ static inline void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_c lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LINE_SPACE, v, selector); } -static inline void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1004,7 +1004,7 @@ static inline void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_d lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_DECOR, v, selector); } -static inline void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1012,7 +1012,7 @@ static inline void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_a lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_ALIGN, v, selector); } -static inline void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_img_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1020,7 +1020,7 @@ static inline void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t val lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_OPA, v, selector); } -static inline void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_img_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1028,7 +1028,7 @@ static inline void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR, v, selector); } -static inline void lv_obj_set_style_img_recolor_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_img_recolor_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1036,7 +1036,7 @@ static inline void lv_obj_set_style_img_recolor_filtered(struct _lv_obj_t * obj, lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_img_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1044,7 +1044,7 @@ static inline void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_o lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR_OPA, v, selector); } -static inline void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_outline_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1052,7 +1052,7 @@ static inline void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coo lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_WIDTH, v, selector); } -static inline void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_outline_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1060,7 +1060,7 @@ static inline void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_col lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_COLOR, v, selector); } -static inline void lv_obj_set_style_outline_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_outline_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1068,7 +1068,7 @@ static inline void lv_obj_set_style_outline_color_filtered(struct _lv_obj_t * ob lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_outline_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1076,7 +1076,7 @@ static inline void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_OPA, v, selector); } -static inline void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_outline_pad(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1084,7 +1084,7 @@ static inline void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_PAD, v, selector); } -static inline void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1092,7 +1092,7 @@ static inline void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_WIDTH, v, selector); } -static inline void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_ofs_x(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1100,7 +1100,7 @@ static inline void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_X, v, selector); } -static inline void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_ofs_y(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1108,7 +1108,7 @@ static inline void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_Y, v, selector); } -static inline void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_spread(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1116,7 +1116,7 @@ static inline void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coo lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_SPREAD, v, selector); } -static inline void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1124,7 +1124,7 @@ static inline void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_colo lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_COLOR, v, selector); } -static inline void lv_obj_set_style_shadow_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1132,7 +1132,7 @@ static inline void lv_obj_set_style_shadow_color_filtered(struct _lv_obj_t * obj lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_shadow_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1140,7 +1140,7 @@ static inline void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OPA, v, selector); } -static inline void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1148,7 +1148,7 @@ static inline void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_ lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_WIDTH, v, selector); } -static inline void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_dash_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1156,7 +1156,7 @@ static inline void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_c lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_WIDTH, v, selector); } -static inline void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_dash_gap(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1164,7 +1164,7 @@ static inline void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coo lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_GAP, v, selector); } -static inline void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_rounded(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1172,7 +1172,7 @@ static inline void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, lv_coor lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_ROUNDED, v, selector); } -static inline void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1180,7 +1180,7 @@ static inline void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_ lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_COLOR, v, selector); } -static inline void lv_obj_set_style_line_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1188,7 +1188,7 @@ static inline void lv_obj_set_style_line_color_filtered(struct _lv_obj_t * obj, lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_line_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1196,7 +1196,7 @@ static inline void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t va lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_OPA, v, selector); } -static inline void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_width(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1204,7 +1204,7 @@ static inline void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_WIDTH, v, selector); } -static inline void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_rounded(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1212,7 +1212,7 @@ static inline void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, lv_coord lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_ROUNDED, v, selector); } -static inline void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1220,7 +1220,7 @@ static inline void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_COLOR, v, selector); } -static inline void lv_obj_set_style_arc_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_color_filtered(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -1228,7 +1228,7 @@ static inline void lv_obj_set_style_arc_color_filtered(struct _lv_obj_t * obj, l lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_COLOR_FILTERED, v, selector); } -static inline void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -1236,7 +1236,7 @@ static inline void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t val lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_OPA, v, selector); } -static inline void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector) +static inline void lv_obj_set_style_arc_img_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value diff --git a/src/core/lv_obj_tree.h b/src/core/lv_obj_tree.h index 7cb241eaf..bffd395ab 100644 --- a/src/core/lv_obj_tree.h +++ b/src/core/lv_obj_tree.h @@ -28,13 +28,17 @@ extern "C" { struct _lv_obj_t; struct _lv_obj_class_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_obj_t lv_obj_t; +typedef struct _lv_obj_class_t lv_obj_class_t; + typedef enum { LV_OBJ_TREE_WALK_NEXT, LV_OBJ_TREE_WALK_SKIP_CHILDREN, LV_OBJ_TREE_WALK_END, } lv_obj_tree_walk_res_t; -typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(struct _lv_obj_t *, void *); +typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(lv_obj_t *, void *); /********************** * GLOBAL PROTOTYPES @@ -46,7 +50,7 @@ typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(struct _lv_obj_t *, void * Send `LV_EVENT_DELETED` to deleted objects. * @param obj pointer to an object */ -void lv_obj_del(struct _lv_obj_t * obj); +void lv_obj_del(lv_obj_t * obj); /** * Delete all children of an object. @@ -54,7 +58,7 @@ void lv_obj_del(struct _lv_obj_t * obj); * Send `LV_EVENT_DELETED` to deleted objects. * @param obj pointer to an object */ -void lv_obj_clean(struct _lv_obj_t * obj); +void lv_obj_clean(lv_obj_t * obj); /** * A function to be easily used in animation ready callback to delete an object when the animation is ready @@ -68,7 +72,7 @@ void lv_obj_del_anim_ready_cb(lv_anim_t * a); * @param obj object to delete * @see lv_async_call */ -void lv_obj_del_async(struct _lv_obj_t * obj); +void lv_obj_del_async(lv_obj_t * obj); /** * Move the parent of an object. The relative coordinates will be kept. @@ -76,7 +80,7 @@ void lv_obj_del_async(struct _lv_obj_t * obj); * @param obj pointer to an object whose parent needs to be changed * @param parent pointer to the new parent */ -void lv_obj_set_parent(struct _lv_obj_t * obj, struct _lv_obj_t * parent); +void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent); /** * Move the object to the foreground. @@ -84,7 +88,7 @@ void lv_obj_set_parent(struct _lv_obj_t * obj, struct _lv_obj_t * parent); * It also means it can cover any of the siblings. * @param obj pointer to an object */ -void lv_obj_move_foreground(struct _lv_obj_t * obj); +void lv_obj_move_foreground(lv_obj_t * obj); /** * Move the object to the background. @@ -92,28 +96,28 @@ void lv_obj_move_foreground(struct _lv_obj_t * obj); * It also means any of the siblings can cover the object. * @param obj pointer to an object */ -void lv_obj_move_background(struct _lv_obj_t * obj); +void lv_obj_move_background(lv_obj_t * obj); /** * Get the screen of an object * @param obj pointer to an object * @return pointer to the obejct's screen */ -struct _lv_obj_t * lv_obj_get_screen(const struct _lv_obj_t * obj); +lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj); /** * Get the display of the object * @param obj pointer to an object * @return pointer to the obejct's display */ -lv_disp_t * lv_obj_get_disp(const struct _lv_obj_t * obj); +lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj); /** * Get the parent of an object * @param obj pointer to an object * @return the parent of the object. (NULL if `obj` was a screen) */ -struct _lv_obj_t * lv_obj_get_parent(const struct _lv_obj_t * obj); +lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj); /** * Get the child of an object by the child's index. @@ -126,14 +130,14 @@ struct _lv_obj_t * lv_obj_get_parent(const struct _lv_obj_t * obj); * -2: the second youngest * @return pointer to the child or NULL if the index was invalid */ -struct _lv_obj_t * lv_obj_get_child(const struct _lv_obj_t * obj, int32_t id); +lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t id); /** * Get the number of children * @param obj pointer to an object * @return the number of children */ -uint32_t lv_obj_get_child_cnt(const struct _lv_obj_t * obj); +uint32_t lv_obj_get_child_cnt(const lv_obj_t * obj); /** * Get the index of a child. @@ -141,7 +145,7 @@ uint32_t lv_obj_get_child_cnt(const struct _lv_obj_t * obj); * @return the child index of the object. * E.g. 0: the oldest (firstly created child) */ -uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj); +uint32_t lv_obj_get_child_id(const lv_obj_t * obj); /** * Iterate through all children of any object. @@ -149,7 +153,7 @@ uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj); * @param cb call this callback on the objects * @param user_data pointer to any user related data (will be passed to `cb`) */ -void lv_obj_tree_walk(struct _lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data); +void lv_obj_tree_walk(lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data); /********************** * MACROS diff --git a/src/core/lv_theme.h b/src/core/lv_theme.h index f287a2c61..47a8cf897 100644 --- a/src/core/lv_theme.h +++ b/src/core/lv_theme.h @@ -26,7 +26,10 @@ extern "C" { struct _lv_theme_t; struct _lv_disp_t; -typedef void (*lv_theme_apply_cb_t)(struct _lv_theme_t *, lv_obj_t *); +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_theme_t lv_theme_t; + +typedef void (*lv_theme_apply_cb_t)(lv_theme_t *, lv_obj_t *); typedef struct _lv_theme_t { lv_theme_apply_cb_t apply_cb; diff --git a/src/draw/lv_img_decoder.h b/src/draw/lv_img_decoder.h index 116773451..dd53d144c 100644 --- a/src/draw/lv_img_decoder.h +++ b/src/draw/lv_img_decoder.h @@ -41,9 +41,12 @@ enum { typedef uint8_t lv_img_src_t; /*Decoder function definitions*/ +struct _lv_img_decoder_dsc_t; +struct _lv_img_decoder_t; -struct _lv_img_decoder_dsc; -struct _lv_img_decoder; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_img_decoder_dsc_t lv_img_decoder_dsc_t; +typedef struct _lv_img_decoder_t lv_img_decoder_t; /** * Get info from an image and store in the `header` @@ -52,7 +55,7 @@ struct _lv_img_decoder; * @param header store the info here * @return LV_RES_OK: info written correctly; LV_RES_INV: failed */ -typedef lv_res_t (*lv_img_decoder_info_f_t)(struct _lv_img_decoder * decoder, const void * src, +typedef lv_res_t (*lv_img_decoder_info_f_t)(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); /** @@ -60,7 +63,7 @@ typedef lv_res_t (*lv_img_decoder_info_f_t)(struct _lv_img_decoder * decoder, co * @param decoder pointer to the decoder the function associated with * @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it. */ -typedef lv_res_t (*lv_img_decoder_open_f_t)(struct _lv_img_decoder * decoder, struct _lv_img_decoder_dsc * dsc); +typedef lv_res_t (*lv_img_decoder_open_f_t)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); /** * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`. @@ -73,7 +76,7 @@ typedef lv_res_t (*lv_img_decoder_open_f_t)(struct _lv_img_decoder * decoder, st * @param buf a buffer to store the decoded pixels * @return LV_RES_OK: ok; LV_RES_INV: failed */ -typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder * decoder, struct _lv_img_decoder_dsc * dsc, +typedef lv_res_t (*lv_img_decoder_read_line_f_t)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf); /** @@ -81,10 +84,10 @@ typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder * decode * @param decoder pointer to the decoder the function associated with * @param dsc pointer to decoder descriptor */ -typedef void (*lv_img_decoder_close_f_t)(struct _lv_img_decoder * decoder, struct _lv_img_decoder_dsc * dsc); +typedef void (*lv_img_decoder_close_f_t)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); -typedef struct _lv_img_decoder { +typedef struct _lv_img_decoder_t { lv_img_decoder_info_f_t info_cb; lv_img_decoder_open_f_t open_cb; lv_img_decoder_read_line_f_t read_line_cb; @@ -97,7 +100,7 @@ typedef struct _lv_img_decoder { /**Describe an image decoding session. Stores data about the decoding*/ -typedef struct _lv_img_decoder_dsc { +typedef struct _lv_img_decoder_dsc_t { /**The decoder which was able to open the image source*/ lv_img_decoder_t * decoder; diff --git a/src/extra/layouts/flex/lv_flex.c b/src/extra/layouts/flex/lv_flex.c index 1c201c5c3..97b42b30d 100644 --- a/src/extra/layouts/flex/lv_flex.c +++ b/src/extra/layouts/flex/lv_flex.c @@ -110,7 +110,7 @@ void lv_obj_set_flex_align(lv_obj_t * obj, lv_flex_align_t main_place, lv_flex_a lv_obj_set_style_layout(obj, LV_LAYOUT_FLEX, 0); } -void lv_obj_set_flex_grow(struct _lv_obj_t * obj, uint8_t grow) +void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow) { lv_obj_set_style_flex_grow(obj, grow, 0); } diff --git a/src/extra/layouts/grid/lv_grid.c b/src/extra/layouts/grid/lv_grid.c index 84a1d8fce..cdff82b55 100644 --- a/src/extra/layouts/grid/lv_grid.c +++ b/src/extra/layouts/grid/lv_grid.c @@ -49,7 +49,7 @@ typedef struct { * STATIC PROTOTYPES **********************/ static void grid_update(lv_obj_t * cont, void * user_data); -static void calc(struct _lv_obj_t * obj, _lv_grid_calc_t * calc); +static void calc(lv_obj_t * obj, _lv_grid_calc_t * calc); static void calc_free(_lv_grid_calc_t * calc); static void calc_cols(lv_obj_t * cont, _lv_grid_calc_t * c); static void calc_rows(lv_obj_t * cont, _lv_grid_calc_t * c); @@ -193,7 +193,7 @@ static void grid_update(lv_obj_t * cont, void * user_data) * @param calc store the calculated cells sizes here * @note `_lv_grid_calc_free(calc_out)` needs to be called when `calc_out` is not needed anymore */ -static void calc(struct _lv_obj_t * cont, _lv_grid_calc_t * calc_out) +static void calc(lv_obj_t * cont, _lv_grid_calc_t * calc_out) { if(lv_obj_get_child(cont, 0) == NULL) { lv_memset_00(calc_out, sizeof(_lv_grid_calc_t)); diff --git a/src/extra/layouts/grid/lv_grid.h b/src/extra/layouts/grid/lv_grid.h index 454271df4..7dd73befb 100644 --- a/src/extra/layouts/grid/lv_grid.h +++ b/src/extra/layouts/grid/lv_grid.h @@ -85,7 +85,7 @@ void lv_obj_set_grid_align(lv_obj_t * obj, lv_grid_align_t column_align, lv_grid * @param row_pos row ID * @param row_span number of rows to take (>= 1) */ -void lv_obj_set_grid_cell(struct _lv_obj_t * obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, +void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, lv_grid_align_t row_align, uint8_t row_pos, uint8_t row_span); /** @@ -259,61 +259,61 @@ static inline void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_coord_t lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_Y_ALIGN, v, selector); } -static inline const lv_coord_t * lv_obj_get_style_grid_row_dsc_array(const struct _lv_obj_t * obj, uint32_t part) +static inline const lv_coord_t * lv_obj_get_style_grid_row_dsc_array(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_DSC_ARRAY); return (const lv_coord_t *)v.ptr; } -static inline const lv_coord_t * lv_obj_get_style_grid_column_dsc_array(const struct _lv_obj_t * obj, uint32_t part) +static inline const lv_coord_t * lv_obj_get_style_grid_column_dsc_array(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_DSC_ARRAY); return (const lv_coord_t *)v.ptr; } -static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_ALIGN); return (lv_grid_align_t)v.num; } -static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_ALIGN); return (lv_grid_align_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_POS); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_SPAN); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_POS); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_SPAN); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_X_ALIGN); return (lv_coord_t)v.num; } -static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const struct _lv_obj_t * obj, uint32_t part) +static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_Y_ALIGN); return (lv_coord_t)v.num; diff --git a/src/font/lv_font.h b/src/font/lv_font.h index e66d7696d..2442c4ee3 100644 --- a/src/font/lv_font.h +++ b/src/font/lv_font.h @@ -53,13 +53,18 @@ enum { typedef uint8_t lv_font_subpx_t; +struct _lv_font_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_font_t lv_font_t; + /** Describe the properties of a font*/ -typedef struct _lv_font_struct { +typedef struct _lv_font_t { /** Get a glyph's descriptor from a font*/ - bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next); + bool (*get_glyph_dsc)(const lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next); /** Get a glyph's bitmap from a font*/ - const uint8_t * (*get_glyph_bitmap)(const struct _lv_font_struct *, uint32_t); + const uint8_t * (*get_glyph_bitmap)(const lv_font_t *, uint32_t); /*Pointer to the font in a font pack (must have the same line height)*/ lv_coord_t line_height; /**< The real line height where any text fits*/ diff --git a/src/hal/lv_hal_disp.h b/src/hal/lv_hal_disp.h index d5cbf532f..37ccf68ee 100644 --- a/src/hal/lv_hal_disp.h +++ b/src/hal/lv_hal_disp.h @@ -43,6 +43,10 @@ struct _lv_disp_t; struct _lv_disp_drv_t; struct _lv_theme_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_disp_drv_t lv_disp_drv_t; +typedef struct _lv_obj_t lv_obj_t; + /** * Structure for holding display buffer information. */ @@ -97,38 +101,38 @@ typedef struct _lv_disp_drv_t { /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_disp_flush_ready()' has to be * called when finished*/ - void (*flush_cb)(struct _lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); + void (*flush_cb)(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); /** OPTIONAL: Extend the invalidated areas to match with the display drivers requirements * E.g. round `y` to, 8, 16 ..) on a monochrome display*/ - void (*rounder_cb)(struct _lv_disp_drv_t * disp_drv, lv_area_t * area); + void (*rounder_cb)(lv_disp_drv_t * disp_drv, lv_area_t * area); /** OPTIONAL: Set a pixel in a buffer according to the special requirements of the display * Can be used for color format not supported in LittelvGL. E.g. 2 bit -> 4 gray scales * @note Much slower then drawing with supported color formats.*/ - void (*set_px_cb)(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + void (*set_px_cb)(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); /** OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the * number of flushed pixels*/ - void (*monitor_cb)(struct _lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px); + void (*monitor_cb)(lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px); /** OPTIONAL: Called periodically while lvgl waits for operation to be completed. * For example flushing or GPU * User can execute very simple tasks here or yield the task*/ - void (*wait_cb)(struct _lv_disp_drv_t * disp_drv); + void (*wait_cb)(lv_disp_drv_t * disp_drv); /** OPTIONAL: Called when lvgl needs any CPU cache that affects rendering to be cleaned*/ - void (*clean_dcache_cb)(struct _lv_disp_drv_t * disp_drv); + void (*clean_dcache_cb)(lv_disp_drv_t * disp_drv); /** OPTIONAL: called to wait while the gpu is working*/ - void (*gpu_wait_cb)(struct _lv_disp_drv_t * disp_drv); + void (*gpu_wait_cb)(lv_disp_drv_t * disp_drv); /** OPTIONAL: called when driver parameters are updated */ - void (*drv_update_cb)(struct _lv_disp_drv_t * disp_drv); + void (*drv_update_cb)(lv_disp_drv_t * disp_drv); /** OPTIONAL: Fill a memory with a color (GPU only)*/ - void (*gpu_fill_cb)(struct _lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width, + void (*gpu_fill_cb)(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color); /** On CHROMA_KEYED images this color will be transparent. @@ -156,12 +160,12 @@ typedef struct _lv_disp_t { struct _lv_theme_t * theme; /** Screens of the display*/ - struct _lv_obj_t ** screens; /**< Array of screen objects.*/ - struct _lv_obj_t * act_scr; /**< Currently active screen on this display*/ - struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ - struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/ - struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/ - struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/ + lv_obj_t ** screens; /**< Array of screen objects.*/ + lv_obj_t * act_scr; /**< Currently active screen on this display*/ + lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ + lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/ + lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/ + lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/ uint32_t screen_cnt; uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load animation is ready*/ diff --git a/src/hal/lv_hal_indev.h b/src/hal/lv_hal_indev.h index bc18c2a39..f28e8a330 100644 --- a/src/hal/lv_hal_indev.h +++ b/src/hal/lv_hal_indev.h @@ -58,6 +58,12 @@ struct _lv_group_t; struct _lv_indev_t; struct _lv_indev_drv_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_indev_drv_t lv_indev_drv_t; +typedef struct _lv_indev_t lv_indev_t; +typedef struct _lv_group_t lv_group_t; +typedef struct _lv_obj_t lv_obj_t; + /** Possible input device types*/ typedef enum { LV_INDEV_TYPE_NONE, /**< Uninitialized state*/ @@ -91,11 +97,11 @@ typedef struct _lv_indev_drv_t { lv_indev_type_t type; /**< Function pointer to read input device data.*/ - void (*read_cb)(struct _lv_indev_drv_t * indev_drv, lv_indev_data_t * data); + void (*read_cb)(lv_indev_drv_t * indev_drv, lv_indev_data_t * data); /** Called when an action happened on the input device. * The second parameter is the event from `lv_event_t`*/ - void (*feedback_cb)(struct _lv_indev_drv_t *, uint8_t); + void (*feedback_cb)(lv_indev_drv_t *, uint8_t); #if LV_USE_USER_DATA void * user_data; @@ -124,7 +130,7 @@ typedef struct _lv_indev_drv_t { /**< Repeated trigger period in long press [ms]*/ uint16_t long_press_repeat_time; -} lv_indev_drv_t; +} _lv_indev_drv_t; /** Run time data of input devices * Internally used by the library, you should not need to touch it. @@ -147,10 +153,10 @@ typedef struct _lv_indev_proc_t { lv_point_t scroll_sum; /*Count the dragged pixels to check LV_INDEV_DEF_SCROLL_LIMIT*/ lv_point_t scroll_throw_vect; lv_point_t scroll_throw_vect_ori; - struct _lv_obj_t * act_obj; /*The object being pressed*/ - struct _lv_obj_t * last_obj; /*The last object which was pressed*/ - struct _lv_obj_t * scroll_obj; /*The object being scrolled*/ - struct _lv_obj_t * last_pressed; /*The lastly pressed object*/ + lv_obj_t * act_obj; /*The object being pressed*/ + lv_obj_t * last_obj; /*The last object which was pressed*/ + lv_obj_t * scroll_obj; /*The object being scrolled*/ + lv_obj_t * last_pressed; /*The lastly pressed object*/ lv_area_t scroll_area; lv_point_t gesture_sum; /*Count the gesture pixels to check LV_INDEV_DEF_GESTURE_LIMIT*/ @@ -175,8 +181,8 @@ typedef struct _lv_indev_proc_t { typedef struct _lv_indev_t { lv_indev_drv_t * driver; _lv_indev_proc_t proc; - struct _lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/ - struct lv_group_t_struct * group; /**< Keypad destination group*/ + lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/ + lv_group_t * group; /**< Keypad destination group*/ const lv_point_t * btn_points; /**< Array points assigned to the button ()screen will be pressed here by the buttons*/ } _lv_indev_t; diff --git a/src/misc/lv_anim.h b/src/misc/lv_anim.h index 0a8f588a9..f572b6d95 100644 --- a/src/misc/lv_anim.h +++ b/src/misc/lv_anim.h @@ -37,9 +37,11 @@ typedef enum { LV_EXPORT_CONST_INT(LV_ANIM_REPEAT_INFINITE); struct _lv_anim_t; -struct _lv_anim_path_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_anim_t lv_anim_t; + /** Get the current value during an animation*/ -typedef int32_t (*lv_anim_path_cb_t)(const struct _lv_anim_t *); +typedef int32_t (*lv_anim_path_cb_t)(const lv_anim_t *); /** Generic prototype of "animator" functions. * First parameter is the variable to animate. @@ -51,16 +53,16 @@ typedef void (*lv_anim_exec_xcb_t)(void *, int32_t); /** Same as `lv_anim_exec_xcb_t` but receives `lv_anim_t *` as the first parameter. * It's more consistent but less convenient. Might be used by binding generator functions.*/ -typedef void (*lv_anim_custom_exec_cb_t)(struct _lv_anim_t *, int32_t); +typedef void (*lv_anim_custom_exec_cb_t)(lv_anim_t *, int32_t); /** Callback to call when the animation is ready*/ -typedef void (*lv_anim_ready_cb_t)(struct _lv_anim_t *); +typedef void (*lv_anim_ready_cb_t)(lv_anim_t *); /** Callback to call when the animation really stars (considering `delay`)*/ -typedef void (*lv_anim_start_cb_t)(struct _lv_anim_t *); +typedef void (*lv_anim_start_cb_t)(lv_anim_t *); /** Callback used when the animation values are relative to get the current value*/ -typedef int32_t (*lv_anim_get_value_cb_t)(struct _lv_anim_t *); +typedef int32_t (*lv_anim_get_value_cb_t)(lv_anim_t *); /** Describes an animation*/ typedef struct _lv_anim_t { @@ -91,9 +93,6 @@ typedef struct _lv_anim_t { uint32_t time_orig; } _lv_anim_t; - -/*Trick to no expose the fields of the struct in the MicroPython binding*/ -typedef _lv_anim_t lv_anim_t; /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/misc/lv_color.h b/src/misc/lv_color.h index 01d222ce5..0e3b4e7aa 100644 --- a/src/misc/lv_color.h +++ b/src/misc/lv_color.h @@ -266,8 +266,10 @@ typedef uint8_t lv_opa_t; //! @endcond struct _lv_color_filter_dsc_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_color_filter_dsc_t lv_color_filter_dsc_t; -typedef lv_color_t (*lv_color_filter_cb_t)(const struct _lv_color_filter_dsc_t *, lv_color_t, lv_opa_t); +typedef lv_color_t (*lv_color_filter_cb_t)(const lv_color_filter_dsc_t *, lv_color_t, lv_opa_t); typedef struct _lv_color_filter_dsc_t { lv_color_filter_cb_t filter_cb; diff --git a/src/misc/lv_fs.h b/src/misc/lv_fs.h index 44aeb9157..6039991c8 100644 --- a/src/misc/lv_fs.h +++ b/src/misc/lv_fs.h @@ -68,20 +68,25 @@ enum { }; typedef uint8_t lv_fs_whence_t; +struct _lv_fs_drv_t; + +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_fs_drv_t lv_fs_drv_t; + typedef struct _lv_fs_drv_t { char letter; - bool (*ready_cb)(struct _lv_fs_drv_t * drv); + bool (*ready_cb)(lv_fs_drv_t * drv); - void * (*open_cb)(struct _lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); - lv_fs_res_t (*close_cb)(struct _lv_fs_drv_t * drv, void * file_p); - lv_fs_res_t (*read_cb)(struct _lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); - lv_fs_res_t (*write_cb)(struct _lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); - lv_fs_res_t (*seek_cb)(struct _lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); - lv_fs_res_t (*tell_cb)(struct _lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); + void * (*open_cb)(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); + lv_fs_res_t (*close_cb)(lv_fs_drv_t * drv, void * file_p); + lv_fs_res_t (*read_cb)(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); + lv_fs_res_t (*write_cb)(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); + lv_fs_res_t (*seek_cb)(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); + lv_fs_res_t (*tell_cb)(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); - void * (*dir_open_cb)(struct _lv_fs_drv_t * drv, const char * path); - lv_fs_res_t (*dir_read_cb)(struct _lv_fs_drv_t * drv, void * rddir_p, char * fn); - lv_fs_res_t (*dir_close_cb)(struct _lv_fs_drv_t * drv, void * rddir_p); + void * (*dir_open_cb)(lv_fs_drv_t * drv, const char * path); + lv_fs_res_t (*dir_read_cb)(lv_fs_drv_t * drv, void * rddir_p, char * fn); + lv_fs_res_t (*dir_close_cb)(lv_fs_drv_t * drv, void * rddir_p); #if LV_USE_USER_DATA void * user_data; /**< Custom file user data*/ diff --git a/src/misc/lv_timer.h b/src/misc/lv_timer.h index 98595a3d1..839c26ad2 100644 --- a/src/misc/lv_timer.h +++ b/src/misc/lv_timer.h @@ -33,11 +33,13 @@ extern "C" { **********************/ struct _lv_timer_t; +/*Trick to no expose the fields of the struct in the MicroPython binding*/ +typedef struct _lv_timer_t lv_timer_t; /** * Timers execute this type of functions. */ -typedef void (*lv_timer_cb_t)(struct _lv_timer_t *); +typedef void (*lv_timer_cb_t)(lv_timer_t *); /** * Descriptor of a lv_timer