fix(style_gen) update style_api_gen.py according to the changed style properties
This commit is contained in:
@@ -22,6 +22,12 @@ props = [
|
|||||||
{'name': 'PAD_RIGHT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
{'name': 'PAD_RIGHT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
{'name': 'PAD_ROW', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
{'name': 'PAD_ROW', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
{'name': 'PAD_COLUMN', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
{'name': 'PAD_COLUMN', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
|
{'name': 'WIDTH', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
|
{'name': 'HEIGHT', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
|
{'name': 'X', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
|
{'name': 'Y', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
||||||
|
{'name': 'ALIGN', 'style_type': 'num', 'var_type': 'lv_align_t' },
|
||||||
|
{'name': 'LAYOUT', 'style_type': 'num', 'var_type': 'uint16_t' },
|
||||||
{'name': 'BG_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
{'name': 'BG_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||||
{'name': 'BG_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
{'name': 'BG_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||||
{'name': 'BG_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
{'name': 'BG_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||||
@@ -79,17 +85,6 @@ props = [
|
|||||||
{'name': 'ARC_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
{'name': 'ARC_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||||
{'name': 'ARC_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
{'name': 'ARC_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
||||||
{'name': 'ARC_IMG_SRC', 'style_type': 'ptr', 'var_type': 'const void *' },
|
{'name': 'ARC_IMG_SRC', 'style_type': 'ptr', 'var_type': 'const void *' },
|
||||||
{'name': 'CONTENT_TEXT', 'style_type': 'ptr', 'var_type': 'const char *' },
|
|
||||||
{'name': 'CONTENT_ALIGN', 'style_type': 'num', 'var_type': 'lv_align_t' },
|
|
||||||
{'name': 'CONTENT_OFS_X', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
|
||||||
{'name': 'CONTENT_OFS_Y', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
|
||||||
{'name': 'CONTENT_OPA', 'style_type': 'num', 'var_type': 'lv_opa_t' },
|
|
||||||
{'name': 'CONTENT_FONT', 'style_type': 'ptr', 'var_type': 'const lv_font_t *' },
|
|
||||||
{'name': 'CONTENT_COLOR', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
|
||||||
{'name': 'CONTENT_COLOR_FILTERED', 'style_type': 'color', 'var_type': 'lv_color_t' },
|
|
||||||
{'name': 'CONTENT_LETTER_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
|
||||||
{'name': 'CONTENT_LINE_SPACE', 'style_type': 'num', 'var_type': 'lv_coord_t' },
|
|
||||||
{'name': 'CONTENT_DECOR', 'style_type': 'num', 'var_type': 'lv_text_decor_t' },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def obj_style_get(p):
|
def obj_style_get(p):
|
||||||
|
|||||||
@@ -136,19 +136,18 @@ static inline lv_coord_t lv_obj_get_style_y(const struct _lv_obj_t * obj, uint32
|
|||||||
return (lv_coord_t)v.num;
|
return (lv_coord_t)v.num;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint16_t lv_obj_get_style_layout(const struct _lv_obj_t * obj, uint32_t part)
|
static inline lv_align_t lv_obj_get_style_align(const struct _lv_obj_t * obj, uint32_t part)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LAYOUT);
|
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ALIGN);
|
||||||
return (lv_align_t)v.num;
|
return (lv_align_t)v.num;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline lv_coord_t lv_obj_get_style_align(const struct _lv_obj_t * obj, uint32_t part)
|
static inline uint16_t lv_obj_get_style_layout(const struct _lv_obj_t * obj, uint32_t part)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ALIGN);
|
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LAYOUT);
|
||||||
return (lv_coord_t)v.num;
|
return (uint16_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 struct _lv_obj_t * obj, uint32_t part)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR);
|
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR);
|
||||||
@@ -675,15 +674,7 @@ static inline void lv_obj_set_style_y(struct _lv_obj_t * obj, uint32_t part, uin
|
|||||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_Y, v);
|
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_Y, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_align_t value)
|
static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_align_t value)
|
||||||
{
|
|
||||||
lv_style_value_t v = {
|
|
||||||
.num = (int32_t)value
|
|
||||||
};
|
|
||||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LAYOUT, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
.num = (int32_t)value
|
.num = (int32_t)value
|
||||||
@@ -691,6 +682,14 @@ static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, uint32_t part,
|
|||||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ALIGN, v);
|
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ALIGN, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint32_t part, uint32_t state, uint16_t value)
|
||||||
|
{
|
||||||
|
lv_style_value_t v = {
|
||||||
|
.num = (int32_t)value
|
||||||
|
};
|
||||||
|
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LAYOUT, v);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
void lv_extra_init(void)
|
void lv_extra_init(void)
|
||||||
{
|
{
|
||||||
#if LV_USE_FLEX
|
#if LV_USE_FLEX
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ extern "C" {
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initilaize the extra components
|
* Initialize the extra components
|
||||||
*/
|
*/
|
||||||
void lv_extra_init(void);
|
void lv_extra_init(void);
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ static inline void lv_style_set_height(lv_style_t * style, lv_coord_t value)
|
|||||||
lv_style_set_prop(style, LV_STYLE_HEIGHT, v);
|
lv_style_set_prop(style, LV_STYLE_HEIGHT, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void lv_style_set_x(lv_style_t * style, lv_coord_t value)
|
static inline void lv_style_set_x(lv_style_t * style, lv_coord_t value)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
@@ -183,14 +182,6 @@ static inline void lv_style_set_y(lv_style_t * style, lv_coord_t value)
|
|||||||
lv_style_set_prop(style, LV_STYLE_Y, v);
|
lv_style_set_prop(style, LV_STYLE_Y, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void lv_style_set_layout(lv_style_t * style, uint16_t value)
|
|
||||||
{
|
|
||||||
lv_style_value_t v = {
|
|
||||||
.num = (int32_t)value
|
|
||||||
};
|
|
||||||
lv_style_set_prop(style, LV_STYLE_LAYOUT, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void lv_style_set_align(lv_style_t * style, lv_align_t value)
|
static inline void lv_style_set_align(lv_style_t * style, lv_align_t value)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
@@ -199,6 +190,14 @@ static inline void lv_style_set_align(lv_style_t * style, lv_align_t value)
|
|||||||
lv_style_set_prop(style, LV_STYLE_ALIGN, v);
|
lv_style_set_prop(style, LV_STYLE_ALIGN, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void lv_style_set_layout(lv_style_t * style, uint16_t value)
|
||||||
|
{
|
||||||
|
lv_style_value_t v = {
|
||||||
|
.num = (int32_t)value
|
||||||
|
};
|
||||||
|
lv_style_set_prop(style, LV_STYLE_LAYOUT, v);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void lv_style_set_bg_color(lv_style_t * style, lv_color_t value)
|
static inline void lv_style_set_bg_color(lv_style_t * style, lv_color_t value)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
|
|||||||
Reference in New Issue
Block a user