1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

revert attempts to make struct private

feat/priate-struct was create as snapshot before this commit
This commit is contained in:
Gabor Kiss-Vamosi 2021-05-30 15:15:33 +02:00
parent 0ad3dcbf9b
commit 1cb57494df
56 changed files with 431 additions and 660 deletions

View File

@ -82,18 +82,14 @@ typedef enum {
}lv_event_code_t;
typedef struct _lv_event_t {
lv_obj_t * target;
lv_obj_t * current_target;
struct _lv_obj_t * target;
struct _lv_obj_t * current_target;
lv_event_code_t code;
void * user_data;
void * param;
struct _lv_event_t * prev;
uint8_t deleted :1;
}_lv_event_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_event_t lv_event_t;
}lv_event_t;
/**
* @brief Event callback.
@ -135,7 +131,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(lv_obj_t * obj, lv_event_code_t event_code, void * param);
lv_res_t lv_event_send(struct _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 +146,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
*/
lv_obj_t * lv_event_get_target(lv_event_t * e);
struct _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 +154,7 @@ 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
*/
lv_obj_t * lv_event_get_current_target(lv_event_t * e);
struct _lv_obj_t * lv_event_get_current_target(lv_event_t * e);
/**
* Get the event code of an event
@ -200,7 +196,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(lv_obj_t * obj);
void _lv_event_mark_deleted(struct _lv_obj_t * obj);
/**
@ -213,7 +209,7 @@ void _lv_event_mark_deleted(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(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(struct _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 +217,7 @@ struct _lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event
* @param event_cb the event function to remove
* @return true if any event handlers were removed
*/
bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb);
bool lv_obj_remove_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb);
/**
* Remove an event handler function for an object.
@ -229,7 +225,7 @@ bool lv_obj_remove_event_cb(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(lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc);
bool lv_obj_remove_event_dsc(struct _lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc);
/**
* Get the input device passed as parameter to indev related events.

View File

@ -49,11 +49,7 @@ typedef uint8_t lv_key_t;
struct _lv_obj_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 *);
typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
/**
* Groups can be used to logically hold objects so that they can be individually focused.
@ -61,7 +57,7 @@ typedef void (*lv_group_focus_cb_t)(lv_group_t *);
*/
typedef struct _lv_group_t {
lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/
lv_obj_t ** obj_focus; /**< The object in focus*/
struct _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
@ -74,7 +70,7 @@ typedef struct _lv_group_t {
deletion.*/
uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end
of list.*/
} _lv_group_t;
} lv_group_t;
typedef enum {
@ -121,13 +117,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, lv_obj_t * obj);
void lv_group_add_obj(lv_group_t * group, struct _lv_obj_t * obj);
/**
* Remove an object from its group
* @param obj pointer to an object to remove
*/
void lv_group_remove_obj(lv_obj_t * obj);
void lv_group_remove_obj(struct _lv_obj_t * obj);
/**
* Remove all objects from a group
@ -139,7 +135,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(lv_obj_t * obj);
void lv_group_focus_obj(struct _lv_obj_t * obj);
/**
* Focus the next object in a group (defocus the current)
@ -202,7 +198,7 @@ void lv_group_set_wrap(lv_group_t * group, bool en);
* @param group pointer to a group
* @return pointer to the focused object
*/
lv_obj_t * lv_group_get_focused(const lv_group_t * group);
struct _lv_obj_t * lv_group_get_focused(const lv_group_t * group);
/**
* Get the focus callback function of a group

View File

@ -33,8 +33,6 @@ 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.
@ -139,7 +137,7 @@ extern const lv_obj_class_t lv_obj_class;
* They are allocated automatically if any elements is set.
*/
typedef struct {
lv_obj_t ** children; /**< Store the pointer of the children in an array.*/
struct _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;
@ -158,7 +156,7 @@ typedef struct {
typedef struct _lv_obj_t {
const lv_obj_class_t * class_p;
lv_obj_t * parent;
struct _lv_obj_t * parent;
_lv_obj_spec_attr_t * spec_attr;
_lv_obj_style_t * styles;
#if LV_USE_USER_DATA
@ -173,7 +171,7 @@ typedef struct _lv_obj_t {
uint16_t style_cnt :6;
uint16_t h_layout :1;
uint16_t w_layout :1;
}_lv_obj_t;
}lv_obj_t;
/**********************

View File

@ -29,11 +29,6 @@ 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,
@ -46,21 +41,19 @@ typedef enum {
LV_OBJ_CLASS_GROUP_DEF_FALSE,
}lv_obj_class_group_def_t;
typedef void (*lv_obj_class_event_cb_t)(lv_obj_class_t * class_p, lv_event_t * e);
typedef void (*lv_obj_class_event_cb_t)(struct _lv_obj_class_t * class_p, struct _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 lv_obj_class_t * class_p, lv_obj_t * obj);
void (*destructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj);
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);
#if LV_USE_USER_DATA
void * user_data;
#endif
void (*event_cb)(const lv_obj_class_t * class_p, lv_event_t * e); /**< Widget type specific event function*/
void (*event_cb)(const struct _lv_obj_class_t * class_p, struct _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*/
@ -78,15 +71,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
*/
lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * parent);
struct _lv_obj_t * lv_obj_class_create_obj(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent);
void lv_obj_class_init_obj(lv_obj_t * obj);
void lv_obj_class_init_obj(struct _lv_obj_t * obj);
void _lv_obj_destructor(lv_obj_t * obj);
void _lv_obj_destructor(struct _lv_obj_t * obj);
bool lv_obj_is_editable(lv_obj_t * obj);
bool lv_obj_is_editable(struct _lv_obj_t * obj);
bool lv_obj_is_group_def(lv_obj_t * obj);
bool lv_obj_is_group_def(struct _lv_obj_t * obj);
/**********************
* MACROS

View File

@ -24,8 +24,6 @@ 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 {
@ -67,7 +65,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(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc);
void lv_obj_init_draw_rect_dsc(struct _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
@ -77,7 +75,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t
* 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(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc);
void lv_obj_init_draw_label_dsc(struct _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
@ -86,7 +84,7 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc
* @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(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc);
void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc);
/**
@ -96,7 +94,7 @@ void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t *
* @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(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc);
void lv_obj_init_draw_line_dsc(struct _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
@ -105,7 +103,7 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t
* @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(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc);
void lv_obj_init_draw_arc_dsc(struct _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.
@ -113,7 +111,7 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t *
* @param part part of the object
* @return the extra size required around the object
*/
lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part);
lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part);
/**
* Initialize a draw descriptor used in events.
@ -127,14 +125,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(lv_obj_t * obj);
void lv_obj_refresh_ext_draw_size(struct _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 lv_obj_t * obj);
lv_coord_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj);
/**********************
* MACROS

View File

@ -23,10 +23,8 @@ extern "C" {
* TYPEDEFS
**********************/
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 void (*lv_layout_update_cb_t)(lv_obj_t *, void * user_data);
typedef void (*lv_layout_update_cb_t)(struct _lv_obj_t *, void * user_data);
typedef struct {
lv_layout_update_cb_t cb;
void * user_data;
@ -42,21 +40,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(lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
void lv_obj_set_pos(struct _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(lv_obj_t * obj, lv_coord_t x);
void lv_obj_set_x(struct _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(lv_obj_t * obj, lv_coord_t y);
void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y);
/**
* Set the size of an object.
@ -69,14 +67,14 @@ void lv_obj_set_y(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(lv_obj_t * obj, lv_coord_t w, lv_coord_t h);
void lv_obj_set_size(struct _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(lv_obj_t * obj);
bool lv_obj_refr_size(struct _lv_obj_t * obj);
/**
* Set the width of an object
@ -88,7 +86,7 @@ bool lv_obj_refr_size(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(lv_obj_t * obj, lv_coord_t w);
void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w);
/**
* Set the height of an object
@ -100,47 +98,47 @@ void lv_obj_set_width(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(lv_obj_t * obj, lv_coord_t h);
void lv_obj_set_height(struct _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(lv_obj_t * obj, lv_coord_t w);
void lv_obj_set_content_width(struct _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(lv_obj_t * obj, lv_coord_t h);
void lv_obj_set_content_height(struct _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(lv_obj_t * obj, uint32_t layout);
void lv_obj_set_layout(struct _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 lv_obj_t * obj);
bool lv_obj_is_layout_positioned(const struct _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(lv_obj_t * obj);
void lv_obj_mark_layout_as_dirty(struct _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 lv_obj_t * obj);
void lv_obj_update_layout(const struct _lv_obj_t * obj);
/**
* Regsiter a new layout
@ -155,7 +153,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(lv_obj_t * obj, lv_align_t align);
void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align);
/**
* Change the alignment of an object and set new coordinates.
@ -167,7 +165,7 @@ void lv_obj_set_align(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(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
void lv_obj_align(struct _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.
@ -178,14 +176,14 @@ void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t
* @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(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
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);
/**
* 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(lv_obj_t * obj)
static inline void lv_obj_center(struct _lv_obj_t * obj)
{
lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0);
}
@ -196,7 +194,7 @@ static inline void lv_obj_center(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 lv_obj_t * obj, lv_area_t * coords);
void lv_obj_get_coords(const struct _lv_obj_t * obj, lv_area_t * coords);
/**
* Get the x coordinate of object.
@ -206,7 +204,7 @@ void lv_obj_get_coords(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj);
/**
* Get the x2 coordinate of object.
@ -216,7 +214,7 @@ lv_coord_t lv_obj_get_x(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj);
/**
* Get the y coordinate of object.
@ -226,7 +224,7 @@ lv_coord_t lv_obj_get_x2(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj);
/**
* Get the y2 coordinate of object.
@ -236,42 +234,42 @@ lv_coord_t lv_obj_get_y(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_y2(const struct _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 lv_obj_t * obj);
lv_coord_t lv_obj_get_width(const struct _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 lv_obj_t * obj);
lv_coord_t lv_obj_get_height(const struct _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 lv_obj_t * obj);
lv_coord_t lv_obj_get_content_width(const struct _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 lv_obj_t * obj);
lv_coord_t lv_obj_get_content_height(const struct _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 lv_obj_t * obj, lv_area_t * area);
void lv_obj_get_content_coords(const struct _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.
@ -280,7 +278,7 @@ void lv_obj_get_content_coords(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj);
/**
* Get the height occupied by the "parts" of the widget. E.g. the height of all rows of a table.
@ -289,21 +287,21 @@ lv_coord_t lv_obj_get_self_width(const 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 lv_obj_t * obj);
lv_coord_t lv_obj_get_self_height(const struct _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(lv_obj_t * obj);
bool lv_obj_refresh_self_size(struct _lv_obj_t * obj);
void lv_obj_refr_pos(lv_obj_t * obj);
void lv_obj_refr_pos(struct _lv_obj_t * obj);
void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
void lv_obj_move_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating);
void lv_obj_move_children_by(struct _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.
@ -311,13 +309,13 @@ void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_dif
* @param obj pointer to an object
* @param area the area to redraw
*/
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area);
void lv_obj_invalidate_area(const struct _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 lv_obj_t * obj);
void lv_obj_invalidate(const struct _lv_obj_t * obj);
/**
* Tell whether an area of an object is visible (even partially) now or not
@ -325,21 +323,21 @@ void lv_obj_invalidate(const 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 lv_obj_t * obj, lv_area_t * area);
bool lv_obj_area_is_visible(const struct _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 lv_obj_t * obj);
bool lv_obj_is_visible(const struct _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(lv_obj_t * obj, lv_coord_t size);
void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, lv_coord_t size);
/**
* Get the an area where to object can be clicked.
@ -347,7 +345,7 @@ void lv_obj_set_ext_click_area(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 lv_obj_t * obj, lv_area_t * area);
void lv_obj_get_click_area(const struct _lv_obj_t * obj, lv_area_t * area);
/**
* Hit-test an object given a particular point in screen space.
@ -355,7 +353,7 @@ void lv_obj_get_click_area(const 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(lv_obj_t * obj, const lv_point_t * point);
bool lv_obj_hit_test(struct _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

View File

@ -27,9 +27,6 @@ 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*/
@ -62,28 +59,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(lv_obj_t * obj, lv_scrollbar_mode_t mode);
void lv_obj_set_scrollbar_mode(struct _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(lv_obj_t * obj, lv_dir_t dir);
void lv_obj_set_scroll_dir(struct _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(lv_obj_t * obj, lv_scroll_snap_t align);
void lv_obj_set_scroll_snap_x(struct _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(lv_obj_t * obj, lv_scroll_snap_t align);
void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align);
/*=====================
* Getter functions
@ -94,28 +91,28 @@ void lv_obj_set_scroll_snap_y(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 lv_obj_t * obj);
lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const struct _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 lv_obj_t * obj);
lv_dir_t lv_obj_get_scroll_dir(const struct _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 lv_obj_t * obj);
lv_scroll_snap_t lv_obj_get_scroll_snap_x(const struct _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 lv_obj_t * obj);
lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj);
/**
* Get current X scroll position.
@ -125,7 +122,7 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj);
* If scrolled return > 0
* If scrolled in (elastic scroll) return < 0
*/
lv_coord_t lv_obj_get_scroll_x(const lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj);
/**
* Get current Y scroll position.
@ -135,7 +132,7 @@ lv_coord_t lv_obj_get_scroll_x(const lv_obj_t * obj);
* If scrolled return > 0
* If scrolled inside return < 0
*/
lv_coord_t lv_obj_get_scroll_y(const lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj);
/**
* Return the height of the area above the object.
@ -144,7 +141,7 @@ lv_coord_t lv_obj_get_scroll_y(const 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(lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj);
/**
* Return the height of the area below the object.
@ -153,7 +150,7 @@ lv_coord_t lv_obj_get_scroll_top(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(lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj);
/**
* Return the width of the area on the left the object.
@ -162,7 +159,7 @@ lv_coord_t lv_obj_get_scroll_bottom(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(lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj);
/**
* Return the width of the area on the right the object.
@ -171,7 +168,7 @@ lv_coord_t lv_obj_get_scroll_left(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(lv_obj_t * obj);
lv_coord_t lv_obj_get_scroll_right(struct _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.
@ -195,7 +192,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(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_by(struct _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.
@ -205,7 +202,7 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable
* @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(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_to(struct _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.
@ -214,7 +211,7 @@ void lv_obj_scroll_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable
* @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(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en);
/**
* Scroll to a given Y coordinate on an object
@ -223,14 +220,14 @@ void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en);
* @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(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_y(struct _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(lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
/**
* Scroll to an object until it becomes visible on its parent.
@ -239,21 +236,21 @@ void lv_obj_scroll_to_view(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(lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_view_recursive(struct _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 lv_obj_t * obj);
bool lv_obj_is_scrolling(const struct _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(lv_obj_t * obj, lv_anim_enable_t anim_en);
void lv_obj_update_snap(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
/**
* Get the area of the scrollbars
@ -261,13 +258,13 @@ void lv_obj_update_snap(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(lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver);
void lv_obj_get_scrollbar_area(struct _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(lv_obj_t * obj);
void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj);
/**********************
* MACROS

View File

@ -27,9 +27,6 @@ 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*/
@ -75,7 +72,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(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector);
void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector);
/**
* Add a style to an object.
@ -86,13 +83,13 @@ void lv_obj_add_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t se
* @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(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector);
void lv_obj_remove_style(struct _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(lv_obj_t * obj)
static inline void lv_obj_remove_style_all(struct _lv_obj_t * obj)
{
lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY);
}
@ -112,7 +109,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(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop);
void lv_obj_refresh_style(struct _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
@ -131,7 +128,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 lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop);
lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop);
/**
* Set local style property on an object's part and state.
@ -141,9 +138,9 @@ lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_
* @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(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(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);
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);
/**
* Remove a local style property from a part of an object with a given state.
@ -153,7 +150,7 @@ lv_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_st
* @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(lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector);
bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector);
/**
* Used internally to create a style tarnsition
@ -163,7 +160,7 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_sty
* @param new_state
* @param 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);
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);
/**
* Used internally to compare the appearance of an object in 2 states
@ -172,7 +169,7 @@ void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t
* @param state2
* @return
*/
_lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2);
_lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_state_t state1, lv_state_t state2);
/**
* Fade in an an object and all its children.
@ -180,7 +177,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
* @param time time of fade
* @param delay delay to start the animation
*/
void lv_obj_fade_in(lv_obj_t * obj, uint32_t time, uint32_t delay);
void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
/**
* Fade out an an object and all its children.
@ -188,7 +185,7 @@ void lv_obj_fade_in(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(lv_obj_t * obj, uint32_t time, uint32_t delay);
void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector);
@ -196,29 +193,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(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
static inline void lv_obj_set_style_pad_all(struct _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(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
static inline void lv_obj_set_style_pad_hor(struct _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(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
static inline void lv_obj_set_style_pad_ver(struct _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(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
static inline void lv_obj_set_style_pad_gap(struct _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(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
static inline void lv_obj_set_style_size(struct _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);
}

File diff suppressed because it is too large Load Diff

View File

@ -28,17 +28,13 @@ 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)(lv_obj_t *, void *);
typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(struct _lv_obj_t *, void *);
/**********************
* GLOBAL PROTOTYPES
@ -50,7 +46,7 @@ typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(lv_obj_t *, void *);
* Send `LV_EVENT_DELETED` to deleted objects.
* @param obj pointer to an object
*/
void lv_obj_del(lv_obj_t * obj);
void lv_obj_del(struct _lv_obj_t * obj);
/**
* Delete all children of an object.
@ -58,7 +54,7 @@ void lv_obj_del(lv_obj_t * obj);
* Send `LV_EVENT_DELETED` to deleted objects.
* @param obj pointer to an object
*/
void lv_obj_clean(lv_obj_t * obj);
void lv_obj_clean(struct _lv_obj_t * obj);
/**
* A function to be easily used in animation ready callback to delete an object when the animation is ready
@ -72,7 +68,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(lv_obj_t * obj);
void lv_obj_del_async(struct _lv_obj_t * obj);
/**
* Move the parent of an object. The relative coordinates will be kept.
@ -80,7 +76,7 @@ void lv_obj_del_async(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(lv_obj_t * obj, lv_obj_t * parent);
void lv_obj_set_parent(struct _lv_obj_t * obj, struct _lv_obj_t * parent);
/**
* Move the object to the foreground.
@ -88,7 +84,7 @@ void lv_obj_set_parent(lv_obj_t * obj, 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(lv_obj_t * obj);
void lv_obj_move_foreground(struct _lv_obj_t * obj);
/**
* Move the object to the background.
@ -96,28 +92,28 @@ void lv_obj_move_foreground(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(lv_obj_t * obj);
void lv_obj_move_background(struct _lv_obj_t * obj);
/**
* Get the screen of an object
* @param obj pointer to an object
* @return pointer to the obejct's screen
*/
lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj);
struct _lv_obj_t * lv_obj_get_screen(const struct _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 lv_obj_t * obj);
lv_disp_t * lv_obj_get_disp(const struct _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)
*/
lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj);
struct _lv_obj_t * lv_obj_get_parent(const struct _lv_obj_t * obj);
/**
* Get the child of an object by the child's index.
@ -130,14 +126,14 @@ lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj);
* -2: the second youngest
* @return pointer to the child or NULL if the index was invalid
*/
lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t id);
struct _lv_obj_t * lv_obj_get_child(const struct _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 lv_obj_t * obj);
uint32_t lv_obj_get_child_cnt(const struct _lv_obj_t * obj);
/**
* Get the index of a child.
@ -145,7 +141,7 @@ uint32_t lv_obj_get_child_cnt(const 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 lv_obj_t * obj);
uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj);
/**
* Iterate through all children of any object.
@ -153,7 +149,7 @@ uint32_t lv_obj_get_child_id(const 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(lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data);
void lv_obj_tree_walk(struct _lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data);
/**********************
* MACROS

View File

@ -26,10 +26,7 @@ extern "C" {
struct _lv_theme_t;
struct _lv_disp_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 void (*lv_theme_apply_cb_t)(struct _lv_theme_t *, lv_obj_t *);
typedef struct _lv_theme_t {
lv_theme_apply_cb_t apply_cb;

View File

@ -477,8 +477,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size);
#if LV_DRAW_COMPLEX
_lv_img_transform_dsc_t trans_dsc;
lv_memset_00(&trans_dsc, sizeof(_lv_img_transform_dsc_t));
lv_img_transform_dsc_t trans_dsc;
lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t));
if(transform) {
lv_img_cf_t cf = LV_IMG_CF_TRUE_COLOR;
if(alpha_byte) cf = LV_IMG_CF_TRUE_COLOR_ALPHA;

View File

@ -130,10 +130,7 @@ typedef struct {
/*Invert the mask. The default is: Keep the left part.
*It is used to select left/right/top/bottom*/
uint8_t inv: 1;
} _lv_draw_mask_line_param_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_draw_mask_line_param_t lv_draw_mask_line_param_t;
} lv_draw_mask_line_param_t;
typedef struct {
/*The first element must be the common descriptor*/
@ -148,10 +145,7 @@ typedef struct {
lv_draw_mask_line_param_t start_line;
lv_draw_mask_line_param_t end_line;
uint16_t delta_deg;
} _lv_draw_mask_angle_param_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_draw_mask_angle_param_t lv_draw_mask_angle_param_t;
} lv_draw_mask_angle_param_t;
typedef struct {
/*The first element must be the common descriptor*/
@ -166,10 +160,8 @@ typedef struct {
int32_t y_prev;
lv_sqrt_res_t y_prev_x;
} _lv_draw_mask_radius_param_t;
} lv_draw_mask_radius_param_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_draw_mask_radius_param_t lv_draw_mask_radius_param_t;
typedef struct {
/*The first element must be the common descriptor*/
@ -183,10 +175,8 @@ typedef struct {
lv_opa_t opa_bottom;
} cfg;
} _lv_draw_mask_fade_param_t;
} lv_draw_mask_fade_param_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_draw_mask_fade_param_t lv_draw_mask_fade_param_t;
typedef struct _lv_draw_mask_map_param_t {
/*The first element must be the common descriptor*/
@ -196,10 +186,8 @@ typedef struct _lv_draw_mask_map_param_t {
lv_area_t coords;
const lv_opa_t * map;
} cfg;
} _lv_draw_mask_map_param_t;
} lv_draw_mask_map_param_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_draw_mask_map_param_t lv_draw_mask_map_param_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -415,7 +415,7 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
* Initialize a descriptor to transform an image
* @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized
*/
void _lv_img_buf_transform_init(_lv_img_transform_dsc_t * dsc)
void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
{
dsc->tmp.pivot_x_256 = dsc->cfg.pivot_x * 256;
dsc->tmp.pivot_y_256 = dsc->cfg.pivot_y * 256;
@ -566,7 +566,7 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t
* @return true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
* @note the result is written back to `dsc->res_color` and `dsc->res_opa`
*/
bool _lv_img_buf_transform(_lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
{
const uint8_t * src_u8 = (const uint8_t *)dsc->cfg.src;
@ -651,7 +651,7 @@ bool _lv_img_buf_transform(_lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord
* Continue transformation by taking the neighbors into account
* @param dsc pointer to the transformation descriptor
*/
bool _lv_img_buf_transform_anti_alias(_lv_img_transform_dsc_t * dsc)
bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc)
{
const uint8_t * src_u8 = dsc->cfg.src;

View File

@ -178,10 +178,8 @@ typedef struct {
uint32_t pxi;
uint8_t px_size;
} tmp;
} _lv_img_transform_dsc_t;
} lv_img_transform_dsc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_img_transform_dsc_t lv_img_transform_dsc_t;
/**********************
* GLOBAL PROTOTYPES
@ -270,13 +268,13 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
* Initialize a descriptor to rotate an image
* @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized
*/
void _lv_img_buf_transform_init(_lv_img_transform_dsc_t * dsc);
void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc);
/**
* Continue transformation by taking the neighbors into account
* @param dsc pointer to the transformation descriptor
*/
bool _lv_img_buf_transform_anti_alias(_lv_img_transform_dsc_t * dsc);
bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
/**
* Get which color and opa would come to a pixel if it were rotated
@ -286,7 +284,7 @@ bool _lv_img_buf_transform_anti_alias(_lv_img_transform_dsc_t * dsc);
* @return true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
* @note the result is written back to `dsc->res_color` and `dsc->res_opa`
*/
bool _lv_img_buf_transform(_lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y);
bool _lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t y);
#endif
/**

View File

@ -44,10 +44,6 @@ typedef uint8_t lv_img_src_t;
struct _lv_img_decoder_dsc_t;
struct _lv_img_decoder_t;
/*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`
* @param src the image source. Can be a pointer to a C array or a file name (Use
@ -55,7 +51,7 @@ typedef struct _lv_img_decoder_t lv_img_decoder_t;
* @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)(lv_img_decoder_t * decoder, const void * src,
typedef lv_res_t (*lv_img_decoder_info_f_t)(struct _lv_img_decoder_t * decoder, const void * src,
lv_img_header_t * header);
/**
@ -63,7 +59,7 @@ typedef lv_res_t (*lv_img_decoder_info_f_t)(lv_img_decoder_t * decoder, const vo
* @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)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc);
typedef lv_res_t (*lv_img_decoder_open_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc);
/**
* Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`.
@ -76,7 +72,7 @@ typedef lv_res_t (*lv_img_decoder_open_f_t)(lv_img_decoder_t * decoder, lv_img_d
* @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)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc,
typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc,
lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf);
/**
@ -84,7 +80,7 @@ typedef lv_res_t (*lv_img_decoder_read_line_f_t)(lv_img_decoder_t * decoder, lv_
* @param decoder pointer to the decoder the function associated with
* @param dsc pointer to decoder descriptor
*/
typedef void (*lv_img_decoder_close_f_t)(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc);
typedef void (*lv_img_decoder_close_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc);
typedef struct _lv_img_decoder_t {

View File

@ -36,10 +36,7 @@ typedef struct {
/*picture sequence */
lv_img_dsc_t **dsc;
int8_t pic_count;
} _lv_animimg_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_animimg_t lv_animimg_t;
} lv_animimg_t;
/*Image parts*/

View File

@ -44,10 +44,7 @@ typedef struct {
uint16_t highlighted_dates_num; /*Number of elements in `highlighted_days`*/
const char * map[8 * 7];
char nums [7 * 6][4];
} _lv_calendar_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_calendar_t lv_calendar_t;
} lv_calendar_t;
extern const lv_obj_class_t lv_calendar_class;

View File

@ -74,10 +74,7 @@ typedef struct {
uint8_t y_ext_buf_assigned : 1;
uint8_t x_axis_sec : 1;
uint8_t y_axis_sec : 1;
} _lv_chart_series_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_chart_series_t lv_chart_series_t;
} lv_chart_series_t;
typedef struct {
lv_point_t pos;
@ -86,10 +83,7 @@ typedef struct {
lv_chart_series_t * ser;
lv_dir_t dir;
uint8_t pos_set:1; /*1: pos is set; 0: point_id is set*/
} _lv_chart_cursor_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_chart_cursor_t lv_chart_cursor_t;
} lv_chart_cursor_t;
typedef struct {
lv_coord_t major_len;
@ -98,10 +92,8 @@ typedef struct {
uint32_t minor_cnt :15;
uint32_t major_cnt :15;
uint32_t label_en :1;
}_lv_chart_tick_dsc_t;
}lv_chart_tick_dsc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_chart_tick_dsc_t lv_chart_tick_dsc_t;
typedef struct {
lv_obj_t obj;
@ -120,10 +112,7 @@ typedef struct {
uint16_t zoom_y;
lv_chart_type_t type :3; /**< Line or column chart*/
lv_chart_update_mode_t update_mode : 1;
}_lv_chart_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_chart_t lv_chart_t;
}lv_chart_t;
extern const lv_obj_class_t lv_chart_class;

View File

@ -46,10 +46,7 @@ typedef struct {
lv_point_t last_press_point;
lv_colorwheel_mode_t mode : 2;
uint8_t mode_fixed : 1;
} _lv_colorwheel_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_colorwheel_t lv_colorwheel_t;
} lv_colorwheel_t;
extern const lv_obj_class_t lv_colorwheel_class;

View File

@ -40,10 +40,7 @@ typedef struct {
const void * img_src_left[_LV_IMGBTN_STATE_NUM]; /*Store left side images to each state*/
const void * img_src_right[_LV_IMGBTN_STATE_NUM]; /*Store right side images to each state*/
lv_img_cf_t act_cf; /*Color format of the currently active image*/
} _lv_imgbtn_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_imgbtn_t lv_imgbtn_t;
} lv_imgbtn_t;
extern const lv_obj_class_t lv_imgbtn_class;

View File

@ -49,10 +49,7 @@ typedef struct {
lv_btnmatrix_t btnm;
lv_obj_t * ta; /*Pointer to the assigned text area*/
lv_keyboard_mode_t mode; /*Key map type*/
} _lv_keyboard_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_keyboard_t lv_keyboard_t;
} lv_keyboard_t;
extern const lv_obj_class_t lv_keyboard_class;

View File

@ -31,10 +31,7 @@ typedef struct {
lv_obj_t obj;
lv_color_t color;
uint8_t bright; /**< Current brightness of the LED (0..255)*/
} _lv_led_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_led_t lv_led_t;
} lv_led_t;
extern const lv_obj_class_t lv_led_class;

View File

@ -44,10 +44,7 @@ typedef struct {
int16_t r_mod;
uint16_t angle_range;
int16_t rotation;
}_lv_meter_scale_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_meter_scale_t lv_meter_scale_t;
}lv_meter_scale_t;
typedef enum {
LV_METER_INDICATOR_TYPE_NEEDLE_IMG,
@ -85,22 +82,14 @@ typedef struct {
uint8_t local_grad :1;
}scale_lines;
} type_data;
}_lv_meter_indicator_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_meter_indicator_t lv_meter_indicator_t;
}lv_meter_indicator_t;
/*Data of line meter*/
typedef struct {
lv_obj_t obj;
lv_ll_t scale_ll;
lv_ll_t indicator_ll;
} _lv_meter_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_meter_t lv_meter_t;
} lv_meter_t;
extern const lv_obj_class_t lv_meter_class;

View File

@ -44,10 +44,7 @@ typedef struct {
char * txt;
lv_style_t style;
uint8_t static_flag : 1;
} _lv_span_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_span_t lv_span_t;
} lv_span_t;
/** Data of label*/
typedef struct {
@ -57,10 +54,7 @@ typedef struct {
uint8_t mode : 2;
uint8_t align : 2;
uint8_t overflow : 1;
} _lv_spangroup_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_spangroup_t lv_spangroup_t;
} lv_spangroup_t;
extern const lv_obj_class_t lv_spangroup_class;

View File

@ -42,10 +42,7 @@ typedef struct {
uint16_t digit_count : 4;
uint16_t dec_point_pos : 4; /*if 0, there is no separator and the number is an integer*/
uint16_t rollover : 1; // Set to true for rollover functionality
} _lv_spinbox_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_spinbox_t lv_spinbox_t;
} lv_spinbox_t;
extern const lv_obj_class_t lv_spinbox_class;

View File

@ -32,10 +32,7 @@ typedef struct
uint16_t tab_cnt;
uint16_t tab_cur;
lv_dir_t tab_pos;
}_lv_tabview_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_tabview_t lv_tabview_t;
}lv_tabview_t;
extern const lv_obj_class_t lv_tabview_class;

View File

@ -27,18 +27,12 @@ extern "C" {
typedef struct {
lv_obj_t obj;
lv_obj_t * tile_act;
}_lv_tileview_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_tileview_t lv_tileview_t;
}lv_tileview_t;
typedef struct {
lv_obj_t obj;
lv_dir_t dir;
}_lv_tileview_tile_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_tileview_tile_t lv_tileview_tile_t;
}lv_tileview_tile_t;
extern const lv_obj_class_t lv_tileview_class;
extern const lv_obj_class_t lv_tileview_tile_class;

View File

@ -24,10 +24,7 @@ extern "C" {
**********************/
typedef struct {
lv_obj_t obj;
}_lv_win_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_win_t lv_win_t;
}lv_win_t;
extern const lv_obj_class_t lv_win_class;

View File

@ -55,16 +55,13 @@ 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_t {
/** Get a glyph's descriptor from a font*/
bool (*get_glyph_dsc)(const lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
bool (*get_glyph_dsc)(const struct _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 lv_font_t *, uint32_t);
const uint8_t * (*get_glyph_bitmap)(const struct _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*/

View File

@ -43,10 +43,7 @@ typedef struct {
int16_t ofs_x; /**< x offset of the bounding box*/
int16_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
#endif
} _lv_font_fmt_txt_glyph_dsc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_glyph_dsc_t lv_font_fmt_txt_glyph_dsc_t;
} lv_font_fmt_txt_glyph_dsc_t;
/** Format of font character map.*/
enum {
@ -113,10 +110,7 @@ typedef struct {
/** Type of this character map*/
lv_font_fmt_txt_cmap_type_t type;
} _lv_font_fmt_txt_cmap_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_cmap_t lv_font_fmt_txt_cmap_t;
} lv_font_fmt_txt_cmap_t;
/** A simple mapping of kern values from pairs*/
typedef struct {
@ -131,10 +125,7 @@ typedef struct {
const int8_t * values;
uint32_t pair_cnt : 30;
uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/
} _lv_font_fmt_txt_kern_pair_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_kern_pair_t lv_font_fmt_txt_kern_pair_t;
} lv_font_fmt_txt_kern_pair_t;
/** More complex but more optimal class based kern value storage*/
typedef struct {
@ -151,10 +142,7 @@ typedef struct {
const uint8_t * right_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/
uint8_t left_class_cnt;
uint8_t right_class_cnt;
} _lv_font_fmt_txt_kern_classes_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_kern_classes_t lv_font_fmt_txt_kern_classes_t;
} lv_font_fmt_txt_kern_classes_t;
/** Bitmap formats*/
typedef enum {
@ -166,10 +154,7 @@ typedef enum {
typedef struct {
uint32_t last_letter;
uint32_t last_glyph_id;
}_lv_font_fmt_txt_glyph_cache_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_glyph_cache_t lv_font_fmt_txt_glyph_cache_t;
} lv_font_fmt_txt_glyph_cache_t;
/*Describe store additional data for fonts*/
typedef struct {
@ -210,10 +195,7 @@ typedef struct {
/*Cache the last letter and is glyph id*/
lv_font_fmt_txt_glyph_cache_t * cache;
} _lv_font_fmt_txt_dsc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_font_fmt_txt_dsc_t lv_font_fmt_txt_dsc_t;
} lv_font_fmt_txt_dsc_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -43,10 +43,6 @@ 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.
*/
@ -64,10 +60,7 @@ typedef struct _lv_disp_draw_buf_t{
volatile int flushing_last;
volatile uint32_t last_area : 1; /*1: the last area is being rendered*/
volatile uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/
} _lv_disp_draw_buf_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_disp_draw_buf_t lv_disp_draw_buf_t;
} lv_disp_draw_buf_t;
typedef enum {
LV_DISP_ROT_NONE = 0,
@ -101,38 +94,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)(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
void (*flush_cb)(struct _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)(lv_disp_drv_t * disp_drv, lv_area_t * area);
void (*rounder_cb)(struct _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)(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)(struct _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)(lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px);
void (*monitor_cb)(struct _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)(lv_disp_drv_t * disp_drv);
void (*wait_cb)(struct _lv_disp_drv_t * disp_drv);
/** OPTIONAL: Called when lvgl needs any CPU cache that affects rendering to be cleaned*/
void (*clean_dcache_cb)(lv_disp_drv_t * disp_drv);
void (*clean_dcache_cb)(struct _lv_disp_drv_t * disp_drv);
/** OPTIONAL: called to wait while the gpu is working*/
void (*gpu_wait_cb)(lv_disp_drv_t * disp_drv);
void (*gpu_wait_cb)(struct _lv_disp_drv_t * disp_drv);
/** OPTIONAL: called when driver parameters are updated */
void (*drv_update_cb)(lv_disp_drv_t * disp_drv);
void (*drv_update_cb)(struct _lv_disp_drv_t * disp_drv);
/** OPTIONAL: Fill a memory with a color (GPU only)*/
void (*gpu_fill_cb)(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
void (*gpu_fill_cb)(struct _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.
@ -151,7 +144,7 @@ typedef struct _lv_disp_drv_t {
*/
typedef struct _lv_disp_t {
/**< Driver to the display*/
lv_disp_drv_t * driver;
struct _lv_disp_drv_t * driver;
/**< A timer which periodically checks the dirty areas and refreshes them*/
lv_timer_t * refr_timer;
@ -160,12 +153,12 @@ typedef struct _lv_disp_t {
struct _lv_theme_t * theme;
/** Screens of the display*/
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*/
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*/
uint32_t screen_cnt;
uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load animation is ready*/
@ -180,10 +173,7 @@ typedef struct _lv_disp_t {
/*Miscellaneous data*/
uint32_t last_activity_time; /**< Last time when there was activity on this display*/
} _lv_disp_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_disp_t lv_disp_t;
} lv_disp_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -58,12 +58,6 @@ 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*/
@ -97,11 +91,11 @@ typedef struct _lv_indev_drv_t {
lv_indev_type_t type;
/**< Function pointer to read input device data.*/
void (*read_cb)(lv_indev_drv_t * indev_drv, lv_indev_data_t * data);
void (*read_cb)(struct _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)(lv_indev_drv_t *, uint8_t);
void (*feedback_cb)(struct _lv_indev_drv_t *, uint8_t);
#if LV_USE_USER_DATA
void * user_data;
@ -130,7 +124,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.
@ -153,10 +147,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;
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*/
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_area_t scroll_area;
lv_point_t gesture_sum; /*Count the gesture pixels to check LV_INDEV_DEF_GESTURE_LIMIT*/
@ -179,16 +173,13 @@ typedef struct _lv_indev_proc_t {
/** The main input device descriptor with driver, runtime data ('proc') and some additional
* information*/
typedef struct _lv_indev_t {
lv_indev_drv_t * driver;
struct _lv_indev_drv_t * driver;
_lv_indev_proc_t proc;
lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/
lv_group_t * group; /**< Keypad destination group*/
struct _lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/
struct _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;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_indev_t lv_indev_t;
} lv_indev_t;
/**********************
* GLOBAL PROTOTYPES
@ -200,21 +191,21 @@ typedef _lv_indev_t lv_indev_t;
* After it you can set the fields.
* @param driver pointer to driver variable to initialize
*/
void lv_indev_drv_init(lv_indev_drv_t * driver);
void lv_indev_drv_init(struct _lv_indev_drv_t * driver);
/**
* Register an initialized input device driver.
* @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
* @return pointer to the new input device or NULL on error
*/
lv_indev_t * lv_indev_drv_register(lv_indev_drv_t * driver);
lv_indev_t * lv_indev_drv_register(struct _lv_indev_drv_t * driver);
/**
* Update the driver in run time.
* @param indev pointer to a input device. (return value of `lv_indev_drv_register`)
* @param new_drv pointer to the new driver
*/
void lv_indev_drv_update(lv_indev_t * indev, lv_indev_drv_t * new_drv);
void lv_indev_drv_update(lv_indev_t * indev, struct _lv_indev_drv_t * new_drv);
/**
* Get the next input device.

View File

@ -37,11 +37,9 @@ typedef enum {
LV_EXPORT_CONST_INT(LV_ANIM_REPEAT_INFINITE);
struct _lv_anim_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 lv_anim_t *);
typedef int32_t (*lv_anim_path_cb_t)(const struct _lv_anim_t *);
/** Generic prototype of "animator" functions.
* First parameter is the variable to animate.
@ -53,16 +51,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)(lv_anim_t *, int32_t);
typedef void (*lv_anim_custom_exec_cb_t)(struct _lv_anim_t *, int32_t);
/** Callback to call when the animation is ready*/
typedef void (*lv_anim_ready_cb_t)(lv_anim_t *);
typedef void (*lv_anim_ready_cb_t)(struct _lv_anim_t *);
/** Callback to call when the animation really stars (considering `delay`)*/
typedef void (*lv_anim_start_cb_t)(lv_anim_t *);
typedef void (*lv_anim_start_cb_t)(struct _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)(lv_anim_t *);
typedef int32_t (*lv_anim_get_value_cb_t)(struct _lv_anim_t *);
/** Describes an animation*/
typedef struct _lv_anim_t {
@ -91,7 +89,7 @@ typedef struct _lv_anim_t {
uint8_t run_round : 1; /**< Indicates the animation has run in this round*/
uint8_t start_cb_called : 1; /**< Indicates that the `start_cb` was already called*/
uint32_t time_orig;
} _lv_anim_t;
} lv_anim_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -266,10 +266,8 @@ 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 lv_color_filter_dsc_t *, lv_color_t, lv_opa_t);
typedef lv_color_t (*lv_color_filter_cb_t)(const struct _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;

View File

@ -68,25 +68,20 @@ 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)(lv_fs_drv_t * drv);
bool (*ready_cb)(struct _lv_fs_drv_t * drv);
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 * (*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 * (*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);
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);
#if LV_USE_USER_DATA
void * user_data; /**< Custom file user data*/

View File

@ -33,10 +33,7 @@ typedef struct {
uint32_t n_size;
lv_ll_node_t * head;
lv_ll_node_t * tail;
} _lv_ll_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_ll_t lv_ll_t;
} lv_ll_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -54,10 +54,7 @@ typedef struct {
void * p;
uint16_t size;
uint8_t used : 1;
} _lv_mem_buf_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_mem_buf_t lv_mem_buf_t;
} lv_mem_buf_t;
typedef lv_mem_buf_t lv_mem_buf_arr_t[LV_MEM_BUF_MAX_NUM];

View File

@ -234,7 +234,7 @@ typedef enum {
/**
* Descriptor for style transitions
*/
typedef struct _lv_style_transiton_t {
typedef struct {
const lv_style_prop_t * props; /**< An array with the properties to animate.*/
#if LV_USE_USER_DATA
void * user_data; /**< A custom user data that will be passed to the animation's user_data */
@ -242,10 +242,7 @@ typedef struct _lv_style_transiton_t {
lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/
uint32_t time; /**< Duration of the transition in [ms]*/
uint32_t delay; /**< Delay before the transition in [ms]*/
}_lv_style_transition_dsc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_style_transition_dsc_t lv_style_transition_dsc_t;
}lv_style_transition_dsc_t;
/**
* Descriptor of a constant style property.
@ -276,10 +273,7 @@ typedef struct {
uint16_t is_const :1;
uint8_t has_group;
uint8_t prop_cnt;
} _lv_style_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_style_t lv_style_t;
} lv_style_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -33,13 +33,11 @@ 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)(lv_timer_t *);
typedef void (*lv_timer_cb_t)(struct _lv_timer_t *);
/**
* Descriptor of a lv_timer
@ -51,10 +49,7 @@ typedef struct _lv_timer_t {
void * user_data; /**< Custom user data*/
int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times*/
uint32_t paused :1;
} _lv_timer_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_timer_t lv_timer_t;
} lv_timer_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -50,10 +50,7 @@ typedef struct {
uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/
uint32_t last_tick; /*Last dragging event timestamp of the arc*/
int16_t last_angle; /*Last dragging angle of the arc*/
}_lv_arc_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_arc_t lv_arc_t;
}lv_arc_t;
extern const lv_obj_class_t lv_arc_class;

View File

@ -54,10 +54,7 @@ typedef struct {
_lv_bar_anim_t cur_value_anim;
_lv_bar_anim_t start_value_anim;
lv_bar_mode_t mode : 2; /**< Type of bar*/
}_lv_bar_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_bar_t lv_bar_t;
}lv_bar_t;
extern const lv_obj_class_t lv_bar_class;

View File

@ -28,10 +28,7 @@ extern "C" {
typedef struct {
lv_obj_t obj;
}_lv_btn_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_btn_t lv_btn_t;
}lv_btn_t;
extern const lv_obj_class_t lv_btn_class;

View File

@ -58,11 +58,7 @@ typedef struct {
uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/
uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BTNMATRIX_BTN_NONE*/
uint8_t one_check : 1; /*Single button toggled at once*/
} _lv_btnmatrix_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_btnmatrix_t lv_btnmatrix_t;
} lv_btnmatrix_t;
extern const lv_obj_class_t lv_btnmatrix_class;

View File

@ -178,7 +178,7 @@ void lv_canvas_transform(lv_obj_t * obj, lv_img_dsc_t * img, int16_t angle, uint
int32_t y;
bool ret;
_lv_img_transform_dsc_t dsc;
lv_img_transform_dsc_t dsc;
dsc.cfg.angle = angle;
dsc.cfg.zoom = zoom;
dsc.cfg.src = img->data;

View File

@ -32,10 +32,7 @@ extern "C" {
typedef struct {
lv_img_t img;
lv_img_dsc_t dsc;
} _lv_canvas_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_canvas_t lv_canvas_t;
} lv_canvas_t;
/**********************
* GLOBAL PROTOTYPES

View File

@ -30,10 +30,7 @@ typedef struct {
lv_obj_t obj;
char * txt;
uint32_t static_txt :1;
}_lv_checkbox_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_checkbox_t lv_checkbox_t;
}lv_checkbox_t;
extern const lv_obj_class_t lv_checkbox_class;

View File

@ -48,18 +48,12 @@ typedef struct {
lv_dir_t dir :4; /**< Direction in which the list should open*/
uint8_t static_txt :1; /**< 1: Only a pointer is saved in `options`*/
uint8_t selected_highlight:1; /**< 1: Make the selected option highlighted in the list*/
}_lv_dropdown_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_dropdown_t lv_dropdown_t;
}lv_dropdown_t;
typedef struct {
lv_obj_t obj;
lv_obj_t * dropdown;
}_lv_dropdown_list_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_dropdown_list_t lv_dropdown_list_t;
}lv_dropdown_list_t;
extern const lv_obj_class_t lv_dropdown_class;
extern const lv_obj_class_t lv_dropdownlist_class;

View File

@ -41,10 +41,7 @@ typedef struct {
uint8_t src_type : 2; /*See: lv_img_src_t*/
uint8_t cf : 5; /*Color format from `lv_img_color_format_t`*/
uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/
} _lv_img_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_img_t lv_img_t;
} lv_img_t;
extern const lv_obj_class_t lv_img_class;

View File

@ -73,10 +73,7 @@ typedef struct {
uint8_t recolor : 1; /*Enable in-line letter re-coloring*/
uint8_t expand : 1; /*Ignore real width (used by the library with LV_LABEL_LONG_SROLL)*/
uint8_t dot_tmp_alloc : 1; /*1: dot_tmp has been allocated;.0: dot_tmp directly holds up to 4 bytes of characters*/
}_lv_label_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_label_t lv_label_t;
}lv_label_t;
extern const lv_obj_class_t lv_label_class;

View File

@ -33,10 +33,7 @@ typedef struct {
const lv_point_t * point_array; /**< Pointer to an array with the points of the line*/
uint16_t point_num; /**< Number of points in 'point_array'*/
uint8_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/
} _lv_line_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_line_t lv_line_t;
} lv_line_t;
extern const lv_obj_class_t lv_line_class;

View File

@ -43,11 +43,7 @@ typedef struct {
uint16_t sel_opt_id_ori; /**< Store the original index on focus*/
lv_roller_mode_t mode : 1;
uint32_t moved : 1;
}_lv_roller_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_roller_t lv_roller_t;
}lv_roller_t;
extern const lv_obj_class_t lv_roller_class;

View File

@ -47,10 +47,7 @@ typedef struct {
int32_t * value_to_set; /*Which bar value to set*/
uint8_t dragging : 1; /*1: the slider is being dragged*/
uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/
}_lv_slider_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_slider_t lv_slider_t;
}lv_slider_t;
extern const lv_obj_class_t lv_slider_class;

View File

@ -34,10 +34,7 @@ extern "C" {
typedef struct {
lv_obj_t obj;
}_lv_switch_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_switch_t lv_switch_t;
}lv_switch_t;
extern const lv_obj_class_t lv_switch_class;

View File

@ -56,10 +56,7 @@ typedef struct {
lv_coord_t * col_w;
uint16_t col_act;
uint16_t row_act;
} _lv_table_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_table_t lv_table_t;
} lv_table_t;
extern const lv_obj_class_t lv_table_class;

View File

@ -63,10 +63,7 @@ typedef struct {
#endif
uint8_t pwd_mode : 1; /*Replace characters with '*'*/
uint8_t one_line : 1; /*One line mode (ignore line breaks)*/
} _lv_textarea_t;
/*Trick to no expose the fields of the struct in the MicroPython binding*/
typedef _lv_textarea_t lv_textarea_t;
} lv_textarea_t;
extern const lv_obj_class_t lv_textarea_class;