From d6e5200013e9d661609aef3213c670d00f87cf70 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 20 Jul 2022 05:32:40 -0400 Subject: [PATCH] refactor(style): store constant property IDs with a pointer instead of directly (#3506) --- docs/overview/style.md | 2 +- scripts/style_api_gen.py | 5 +- src/misc/lv_style.c | 2 + src/misc/lv_style.h | 21 ++- src/misc/lv_style_gen.c | 168 ++++++++++++++++++++ src/misc/lv_style_gen.h | 252 ++++++++++++++++++++---------- tests/src/test_cases/test_style.c | 16 ++ 7 files changed, 373 insertions(+), 93 deletions(-) diff --git a/docs/overview/style.md b/docs/overview/style.md index 25d8ce658..8c777fd8c 100644 --- a/docs/overview/style.md +++ b/docs/overview/style.md @@ -176,7 +176,7 @@ Styles can be built as `const` too to save RAM: const lv_style_const_prop_t style1_props[] = { LV_STYLE_CONST_WIDTH(50), LV_STYLE_CONST_HEIGHT(50), - LV_STYLE_PROP_INV, + LV_STYLE_CONST_PROPS_END }; LV_STYLE_CONST_INIT(style1, style1_props); diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py index 5bcddede5..9b3644d86 100755 --- a/scripts/style_api_gen.py +++ b/scripts/style_api_gen.py @@ -401,12 +401,15 @@ def style_set_c(p): print(" };") print(" lv_style_set_prop(style, LV_STYLE_" + p['name'] +", v);") print("}") + print("") + print("const lv_style_prop_t lv_style_const_prop_id_" + p['name'] + " = LV_STYLE_" + p['name'] + ";") def style_set_h(p): if 'section' in p: return print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value);") + print("extern const lv_style_prop_t lv_style_const_prop_id_" + p['name'] + ";") def local_style_set_c(p): @@ -435,7 +438,7 @@ def style_const_set(p): print("") print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\") print(" { \\") - print(" .prop = LV_STYLE_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\") + print(" .prop_ptr = &lv_style_const_prop_id_" + p['name'] + ", .value = { ." + p['style_type'] +" = " + cast + "val } \\") print(" }") diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c index 444c2fad1..12129af27 100644 --- a/src/misc/lv_style.c +++ b/src/misc/lv_style.c @@ -35,6 +35,8 @@ static void lv_style_set_prop_meta_helper(lv_style_prop_t prop, lv_style_value_t * GLOBAL VARIABLES **********************/ +const lv_style_prop_t lv_style_const_prop_id_inv = LV_STYLE_PROP_INV; + const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PROPS] = { [LV_STYLE_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, [LV_STYLE_MIN_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h index d1f43bfd6..0a5900283 100644 --- a/src/misc/lv_style.h +++ b/src/misc/lv_style.h @@ -61,6 +61,8 @@ LV_EXPORT_CONST_INT(LV_IMG_ZOOM_NONE); #define LV_STYLE_PROP_ID_MASK(prop) ((lv_style_prop_t)((prop) & ~LV_STYLE_PROP_META_MASK)) +#define LV_STYLE_CONST_PROPS_END { .prop_ptr = &lv_style_const_prop_id_inv, .value = { .num = 0 } } + /********************** * TYPEDEFS **********************/ @@ -160,7 +162,7 @@ typedef union { * * Props are split into groups of 16. When adding a new prop to a group, ensure it does not overflow into the next one. */ -typedef enum { +enum { LV_STYLE_PROP_INV = 0, /*Group 0*/ @@ -266,7 +268,9 @@ typedef enum { LV_STYLE_PROP_ANY = 0xFFFF, _LV_STYLE_PROP_CONST = 0xFFFF /* magic value for const styles */ -} lv_style_prop_t; +}; + +typedef uint16_t lv_style_prop_t; enum { LV_STYLE_RES_NOT_FOUND, @@ -293,7 +297,7 @@ typedef struct { * Descriptor of a constant style property. */ typedef struct { - lv_style_prop_t prop; + const lv_style_prop_t * prop_ptr; lv_style_value_t value; } lv_style_const_prop_t; @@ -435,12 +439,13 @@ static inline lv_style_res_t lv_style_get_prop_inlined(const lv_style_t * style, { if(style->prop1 == LV_STYLE_PROP_ANY) { const lv_style_const_prop_t * const_prop; - for(const_prop = style->v_p.const_props; const_prop->prop != LV_STYLE_PROP_INV; const_prop++) { - lv_style_prop_t prop_id = LV_STYLE_PROP_ID_MASK(const_prop->prop); + for(const_prop = style->v_p.const_props; *const_prop->prop_ptr != LV_STYLE_PROP_INV; const_prop++) { + lv_style_prop_t prop_id_and_meta = *const_prop->prop_ptr; + lv_style_prop_t prop_id = LV_STYLE_PROP_ID_MASK(prop_id_and_meta); if(prop_id == prop) { - if(const_prop->prop & LV_STYLE_PROP_META_INHERIT) + if(prop_id_and_meta & LV_STYLE_PROP_META_INHERIT) return LV_STYLE_RES_INHERIT; - *value = (const_prop->prop & LV_STYLE_PROP_META_INITIAL) ? lv_style_prop_get_default(prop_id) : const_prop->value; + *value = (prop_id_and_meta & LV_STYLE_PROP_META_INITIAL) ? lv_style_prop_get_default(prop_id) : const_prop->value; return LV_STYLE_RES_FOUND; } } @@ -554,6 +559,8 @@ static inline bool lv_style_prop_has_flag(lv_style_prop_t prop, uint8_t flag) * GLOBAL VARIABLES *************************/ +extern const lv_style_prop_t lv_style_const_prop_id_inv; + /********************** * MACROS **********************/ diff --git a/src/misc/lv_style_gen.c b/src/misc/lv_style_gen.c index 13d85607a..e7624a0ed 100644 --- a/src/misc/lv_style_gen.c +++ b/src/misc/lv_style_gen.c @@ -8,6 +8,8 @@ void lv_style_set_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_WIDTH = LV_STYLE_WIDTH; + void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -16,6 +18,8 @@ void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MIN_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_MIN_WIDTH = LV_STYLE_MIN_WIDTH; + void lv_style_set_max_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -24,6 +28,8 @@ void lv_style_set_max_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MAX_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_MAX_WIDTH = LV_STYLE_MAX_WIDTH; + void lv_style_set_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -32,6 +38,8 @@ void lv_style_set_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_HEIGHT, v); } +const lv_style_prop_t lv_style_const_prop_id_HEIGHT = LV_STYLE_HEIGHT; + void lv_style_set_min_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -40,6 +48,8 @@ void lv_style_set_min_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MIN_HEIGHT, v); } +const lv_style_prop_t lv_style_const_prop_id_MIN_HEIGHT = LV_STYLE_MIN_HEIGHT; + void lv_style_set_max_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -48,6 +58,8 @@ void lv_style_set_max_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MAX_HEIGHT, v); } +const lv_style_prop_t lv_style_const_prop_id_MAX_HEIGHT = LV_STYLE_MAX_HEIGHT; + void lv_style_set_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -56,6 +68,8 @@ void lv_style_set_x(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_X, v); } +const lv_style_prop_t lv_style_const_prop_id_X = LV_STYLE_X; + void lv_style_set_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -64,6 +78,8 @@ void lv_style_set_y(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_Y, v); } +const lv_style_prop_t lv_style_const_prop_id_Y = LV_STYLE_Y; + void lv_style_set_align(lv_style_t * style, lv_align_t value) { lv_style_value_t v = { @@ -72,6 +88,8 @@ void lv_style_set_align(lv_style_t * style, lv_align_t value) lv_style_set_prop(style, LV_STYLE_ALIGN, v); } +const lv_style_prop_t lv_style_const_prop_id_ALIGN = LV_STYLE_ALIGN; + void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -80,6 +98,8 @@ void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_WIDTH = LV_STYLE_TRANSFORM_WIDTH; + void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -88,6 +108,8 @@ void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_HEIGHT, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_HEIGHT = LV_STYLE_TRANSFORM_HEIGHT; + void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -96,6 +118,8 @@ void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSLATE_X, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSLATE_X = LV_STYLE_TRANSLATE_X; + void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -104,6 +128,8 @@ void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSLATE_Y, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSLATE_Y = LV_STYLE_TRANSLATE_Y; + void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -112,6 +138,8 @@ void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_ZOOM, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_ZOOM = LV_STYLE_TRANSFORM_ZOOM; + void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -120,6 +148,8 @@ void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_ANGLE, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_ANGLE = LV_STYLE_TRANSFORM_ANGLE; + void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -128,6 +158,8 @@ void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_PIVOT_X, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_PIVOT_X = LV_STYLE_TRANSFORM_PIVOT_X; + void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -136,6 +168,8 @@ void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_PIVOT_Y, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_PIVOT_Y = LV_STYLE_TRANSFORM_PIVOT_Y; + void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -144,6 +178,8 @@ void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_TOP, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_TOP = LV_STYLE_PAD_TOP; + void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -152,6 +188,8 @@ void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_BOTTOM, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_BOTTOM = LV_STYLE_PAD_BOTTOM; + void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -160,6 +198,8 @@ void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_LEFT, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_LEFT = LV_STYLE_PAD_LEFT; + void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -168,6 +208,8 @@ void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_RIGHT, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_RIGHT = LV_STYLE_PAD_RIGHT; + void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -176,6 +218,8 @@ void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_ROW, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_ROW = LV_STYLE_PAD_ROW; + void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -184,6 +228,8 @@ void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_COLUMN, v); } +const lv_style_prop_t lv_style_const_prop_id_PAD_COLUMN = LV_STYLE_PAD_COLUMN; + void lv_style_set_bg_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -192,6 +238,8 @@ void lv_style_set_bg_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_BG_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_COLOR = LV_STYLE_BG_COLOR; + void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -200,6 +248,8 @@ void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BG_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_OPA = LV_STYLE_BG_OPA; + void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -208,6 +258,8 @@ void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_BG_GRAD_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_COLOR = LV_STYLE_BG_GRAD_COLOR; + void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value) { lv_style_value_t v = { @@ -216,6 +268,8 @@ void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value) lv_style_set_prop(style, LV_STYLE_BG_GRAD_DIR, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_DIR = LV_STYLE_BG_GRAD_DIR; + void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -224,6 +278,8 @@ void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_BG_MAIN_STOP, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_MAIN_STOP = LV_STYLE_BG_MAIN_STOP; + void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -232,6 +288,8 @@ void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_BG_GRAD_STOP, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_STOP = LV_STYLE_BG_GRAD_STOP; + void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value) { lv_style_value_t v = { @@ -240,6 +298,8 @@ void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value) lv_style_set_prop(style, LV_STYLE_BG_GRAD, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_GRAD = LV_STYLE_BG_GRAD; + void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value) { lv_style_value_t v = { @@ -248,6 +308,8 @@ void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value) lv_style_set_prop(style, LV_STYLE_BG_DITHER_MODE, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_DITHER_MODE = LV_STYLE_BG_DITHER_MODE; + void lv_style_set_bg_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { @@ -256,6 +318,8 @@ void lv_style_set_bg_img_src(lv_style_t * style, const void * value) lv_style_set_prop(style, LV_STYLE_BG_IMG_SRC, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_IMG_SRC = LV_STYLE_BG_IMG_SRC; + void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -264,6 +328,8 @@ void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BG_IMG_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_IMG_OPA = LV_STYLE_BG_IMG_OPA; + void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -272,6 +338,8 @@ void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_IMG_RECOLOR = LV_STYLE_BG_IMG_RECOLOR; + void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -280,6 +348,8 @@ void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_IMG_RECOLOR_OPA = LV_STYLE_BG_IMG_RECOLOR_OPA; + void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -288,6 +358,8 @@ void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_BG_IMG_TILED, v); } +const lv_style_prop_t lv_style_const_prop_id_BG_IMG_TILED = LV_STYLE_BG_IMG_TILED; + void lv_style_set_border_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -296,6 +368,8 @@ void lv_style_set_border_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_BORDER_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_BORDER_COLOR = LV_STYLE_BORDER_COLOR; + void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -304,6 +378,8 @@ void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BORDER_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_BORDER_OPA = LV_STYLE_BORDER_OPA; + void lv_style_set_border_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -312,6 +388,8 @@ void lv_style_set_border_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_BORDER_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_BORDER_WIDTH = LV_STYLE_BORDER_WIDTH; + void lv_style_set_border_side(lv_style_t * style, lv_border_side_t value) { lv_style_value_t v = { @@ -320,6 +398,8 @@ void lv_style_set_border_side(lv_style_t * style, lv_border_side_t value) lv_style_set_prop(style, LV_STYLE_BORDER_SIDE, v); } +const lv_style_prop_t lv_style_const_prop_id_BORDER_SIDE = LV_STYLE_BORDER_SIDE; + void lv_style_set_border_post(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -328,6 +408,8 @@ void lv_style_set_border_post(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_BORDER_POST, v); } +const lv_style_prop_t lv_style_const_prop_id_BORDER_POST = LV_STYLE_BORDER_POST; + void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -336,6 +418,8 @@ void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_OUTLINE_WIDTH = LV_STYLE_OUTLINE_WIDTH; + void lv_style_set_outline_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -344,6 +428,8 @@ void lv_style_set_outline_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_OUTLINE_COLOR = LV_STYLE_OUTLINE_COLOR; + void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -352,6 +438,8 @@ void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_OUTLINE_OPA = LV_STYLE_OUTLINE_OPA; + void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -360,6 +448,8 @@ void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_PAD, v); } +const lv_style_prop_t lv_style_const_prop_id_OUTLINE_PAD = LV_STYLE_OUTLINE_PAD; + void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -368,6 +458,8 @@ void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_WIDTH = LV_STYLE_SHADOW_WIDTH; + void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -376,6 +468,8 @@ void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_X, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_OFS_X = LV_STYLE_SHADOW_OFS_X; + void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -384,6 +478,8 @@ void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_Y, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_OFS_Y = LV_STYLE_SHADOW_OFS_Y; + void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -392,6 +488,8 @@ void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_SPREAD, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_SPREAD = LV_STYLE_SHADOW_SPREAD; + void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -400,6 +498,8 @@ void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_COLOR = LV_STYLE_SHADOW_COLOR; + void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -408,6 +508,8 @@ void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_SHADOW_OPA = LV_STYLE_SHADOW_OPA; + void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -416,6 +518,8 @@ void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_IMG_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_IMG_OPA = LV_STYLE_IMG_OPA; + void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -424,6 +528,8 @@ void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_IMG_RECOLOR = LV_STYLE_IMG_RECOLOR; + void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -432,6 +538,8 @@ void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_IMG_RECOLOR_OPA = LV_STYLE_IMG_RECOLOR_OPA; + void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -440,6 +548,8 @@ void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_LINE_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_WIDTH = LV_STYLE_LINE_WIDTH; + void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -448,6 +558,8 @@ void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_LINE_DASH_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_DASH_WIDTH = LV_STYLE_LINE_DASH_WIDTH; + void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -456,6 +568,8 @@ void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_LINE_DASH_GAP, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_DASH_GAP = LV_STYLE_LINE_DASH_GAP; + void lv_style_set_line_rounded(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -464,6 +578,8 @@ void lv_style_set_line_rounded(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_LINE_ROUNDED, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_ROUNDED = LV_STYLE_LINE_ROUNDED; + void lv_style_set_line_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -472,6 +588,8 @@ void lv_style_set_line_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_LINE_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_COLOR = LV_STYLE_LINE_COLOR; + void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -480,6 +598,8 @@ void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_LINE_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_LINE_OPA = LV_STYLE_LINE_OPA; + void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -488,6 +608,8 @@ void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_ARC_WIDTH, v); } +const lv_style_prop_t lv_style_const_prop_id_ARC_WIDTH = LV_STYLE_ARC_WIDTH; + void lv_style_set_arc_rounded(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -496,6 +618,8 @@ void lv_style_set_arc_rounded(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_ARC_ROUNDED, v); } +const lv_style_prop_t lv_style_const_prop_id_ARC_ROUNDED = LV_STYLE_ARC_ROUNDED; + void lv_style_set_arc_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -504,6 +628,8 @@ void lv_style_set_arc_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_ARC_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_ARC_COLOR = LV_STYLE_ARC_COLOR; + void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -512,6 +638,8 @@ void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_ARC_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_ARC_OPA = LV_STYLE_ARC_OPA; + void lv_style_set_arc_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { @@ -520,6 +648,8 @@ void lv_style_set_arc_img_src(lv_style_t * style, const void * value) lv_style_set_prop(style, LV_STYLE_ARC_IMG_SRC, v); } +const lv_style_prop_t lv_style_const_prop_id_ARC_IMG_SRC = LV_STYLE_ARC_IMG_SRC; + void lv_style_set_text_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -528,6 +658,8 @@ void lv_style_set_text_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_TEXT_COLOR, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_COLOR = LV_STYLE_TEXT_COLOR; + void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -536,6 +668,8 @@ void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_TEXT_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_OPA = LV_STYLE_TEXT_OPA; + void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value) { lv_style_value_t v = { @@ -544,6 +678,8 @@ void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value) lv_style_set_prop(style, LV_STYLE_TEXT_FONT, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_FONT = LV_STYLE_TEXT_FONT; + void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -552,6 +688,8 @@ void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TEXT_LETTER_SPACE, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_LETTER_SPACE = LV_STYLE_TEXT_LETTER_SPACE; + void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -560,6 +698,8 @@ void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_TEXT_LINE_SPACE, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_LINE_SPACE = LV_STYLE_TEXT_LINE_SPACE; + void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value) { lv_style_value_t v = { @@ -568,6 +708,8 @@ void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value) lv_style_set_prop(style, LV_STYLE_TEXT_DECOR, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_DECOR = LV_STYLE_TEXT_DECOR; + void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value) { lv_style_value_t v = { @@ -576,6 +718,8 @@ void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value) lv_style_set_prop(style, LV_STYLE_TEXT_ALIGN, v); } +const lv_style_prop_t lv_style_const_prop_id_TEXT_ALIGN = LV_STYLE_TEXT_ALIGN; + void lv_style_set_radius(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -584,6 +728,8 @@ void lv_style_set_radius(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_RADIUS, v); } +const lv_style_prop_t lv_style_const_prop_id_RADIUS = LV_STYLE_RADIUS; + void lv_style_set_clip_corner(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -592,6 +738,8 @@ void lv_style_set_clip_corner(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_CLIP_CORNER, v); } +const lv_style_prop_t lv_style_const_prop_id_CLIP_CORNER = LV_STYLE_CLIP_CORNER; + void lv_style_set_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -600,6 +748,8 @@ void lv_style_set_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_OPA = LV_STYLE_OPA; + void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value) { lv_style_value_t v = { @@ -608,6 +758,8 @@ void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_DSC, v); } +const lv_style_prop_t lv_style_const_prop_id_COLOR_FILTER_DSC = LV_STYLE_COLOR_FILTER_DSC; + void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -616,6 +768,8 @@ void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_OPA, v); } +const lv_style_prop_t lv_style_const_prop_id_COLOR_FILTER_OPA = LV_STYLE_COLOR_FILTER_OPA; + void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value) { lv_style_value_t v = { @@ -624,6 +778,8 @@ void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value) lv_style_set_prop(style, LV_STYLE_ANIM, v); } +const lv_style_prop_t lv_style_const_prop_id_ANIM = LV_STYLE_ANIM; + void lv_style_set_anim_time(lv_style_t * style, uint32_t value) { lv_style_value_t v = { @@ -632,6 +788,8 @@ void lv_style_set_anim_time(lv_style_t * style, uint32_t value) lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v); } +const lv_style_prop_t lv_style_const_prop_id_ANIM_TIME = LV_STYLE_ANIM_TIME; + void lv_style_set_anim_speed(lv_style_t * style, uint32_t value) { lv_style_value_t v = { @@ -640,6 +798,8 @@ void lv_style_set_anim_speed(lv_style_t * style, uint32_t value) lv_style_set_prop(style, LV_STYLE_ANIM_SPEED, v); } +const lv_style_prop_t lv_style_const_prop_id_ANIM_SPEED = LV_STYLE_ANIM_SPEED; + void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value) { lv_style_value_t v = { @@ -648,6 +808,8 @@ void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t lv_style_set_prop(style, LV_STYLE_TRANSITION, v); } +const lv_style_prop_t lv_style_const_prop_id_TRANSITION = LV_STYLE_TRANSITION; + void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value) { lv_style_value_t v = { @@ -656,6 +818,8 @@ void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value) lv_style_set_prop(style, LV_STYLE_BLEND_MODE, v); } +const lv_style_prop_t lv_style_const_prop_id_BLEND_MODE = LV_STYLE_BLEND_MODE; + void lv_style_set_layout(lv_style_t * style, uint16_t value) { lv_style_value_t v = { @@ -664,6 +828,8 @@ void lv_style_set_layout(lv_style_t * style, uint16_t value) lv_style_set_prop(style, LV_STYLE_LAYOUT, v); } +const lv_style_prop_t lv_style_const_prop_id_LAYOUT = LV_STYLE_LAYOUT; + void lv_style_set_base_dir(lv_style_t * style, lv_base_dir_t value) { lv_style_value_t v = { @@ -671,3 +837,5 @@ void lv_style_set_base_dir(lv_style_t * style, lv_base_dir_t value) }; lv_style_set_prop(style, LV_STYLE_BASE_DIR, v); } + +const lv_style_prop_t lv_style_const_prop_id_BASE_DIR = LV_STYLE_BASE_DIR; diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h index 8bf3b68f4..a86bb15f1 100644 --- a/src/misc/lv_style_gen.h +++ b/src/misc/lv_style_gen.h @@ -1,504 +1,588 @@ void lv_style_set_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_WIDTH; void lv_style_set_min_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_MIN_WIDTH; void lv_style_set_max_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_MAX_WIDTH; void lv_style_set_height(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_HEIGHT; void lv_style_set_min_height(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_MIN_HEIGHT; void lv_style_set_max_height(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_MAX_HEIGHT; void lv_style_set_x(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_X; void lv_style_set_y(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_Y; void lv_style_set_align(lv_style_t * style, lv_align_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ALIGN; void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_WIDTH; void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_HEIGHT; void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSLATE_X; void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSLATE_Y; void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_ZOOM; void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_ANGLE; void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_PIVOT_X; void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSFORM_PIVOT_Y; void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_TOP; void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_BOTTOM; void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_LEFT; void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_RIGHT; void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_ROW; void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_PAD_COLUMN; void lv_style_set_bg_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_COLOR; void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_OPA; void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_COLOR; void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_DIR; void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_MAIN_STOP; void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_GRAD_STOP; void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_GRAD; void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_DITHER_MODE; void lv_style_set_bg_img_src(lv_style_t * style, const void * value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_IMG_SRC; void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_IMG_OPA; void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_IMG_RECOLOR; void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_IMG_RECOLOR_OPA; void lv_style_set_bg_img_tiled(lv_style_t * style, bool value); +extern const lv_style_prop_t lv_style_const_prop_id_BG_IMG_TILED; void lv_style_set_border_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BORDER_COLOR; void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BORDER_OPA; void lv_style_set_border_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BORDER_WIDTH; void lv_style_set_border_side(lv_style_t * style, lv_border_side_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BORDER_SIDE; void lv_style_set_border_post(lv_style_t * style, bool value); +extern const lv_style_prop_t lv_style_const_prop_id_BORDER_POST; void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_OUTLINE_WIDTH; void lv_style_set_outline_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_OUTLINE_COLOR; void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_OUTLINE_OPA; void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_OUTLINE_PAD; void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_WIDTH; void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_OFS_X; void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_OFS_Y; void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_SPREAD; void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_COLOR; void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_SHADOW_OPA; void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_IMG_OPA; void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_IMG_RECOLOR; void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_IMG_RECOLOR_OPA; void lv_style_set_line_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_WIDTH; void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_DASH_WIDTH; void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_DASH_GAP; void lv_style_set_line_rounded(lv_style_t * style, bool value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_ROUNDED; void lv_style_set_line_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_COLOR; void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LINE_OPA; void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ARC_WIDTH; void lv_style_set_arc_rounded(lv_style_t * style, bool value); +extern const lv_style_prop_t lv_style_const_prop_id_ARC_ROUNDED; void lv_style_set_arc_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ARC_COLOR; void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ARC_OPA; void lv_style_set_arc_img_src(lv_style_t * style, const void * value); +extern const lv_style_prop_t lv_style_const_prop_id_ARC_IMG_SRC; void lv_style_set_text_color(lv_style_t * style, lv_color_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_COLOR; void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_OPA; void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_FONT; void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_LETTER_SPACE; void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_LINE_SPACE; void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_DECOR; void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value); +extern const lv_style_prop_t lv_style_const_prop_id_TEXT_ALIGN; void lv_style_set_radius(lv_style_t * style, lv_coord_t value); +extern const lv_style_prop_t lv_style_const_prop_id_RADIUS; void lv_style_set_clip_corner(lv_style_t * style, bool value); +extern const lv_style_prop_t lv_style_const_prop_id_CLIP_CORNER; void lv_style_set_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_OPA; void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value); +extern const lv_style_prop_t lv_style_const_prop_id_COLOR_FILTER_DSC; void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value); +extern const lv_style_prop_t lv_style_const_prop_id_COLOR_FILTER_OPA; void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value); +extern const lv_style_prop_t lv_style_const_prop_id_ANIM; void lv_style_set_anim_time(lv_style_t * style, uint32_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ANIM_TIME; void lv_style_set_anim_speed(lv_style_t * style, uint32_t value); +extern const lv_style_prop_t lv_style_const_prop_id_ANIM_SPEED; void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value); +extern const lv_style_prop_t lv_style_const_prop_id_TRANSITION; void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BLEND_MODE; void lv_style_set_layout(lv_style_t * style, uint16_t value); +extern const lv_style_prop_t lv_style_const_prop_id_LAYOUT; void lv_style_set_base_dir(lv_style_t * style, lv_base_dir_t value); +extern const lv_style_prop_t lv_style_const_prop_id_BASE_DIR; #define LV_STYLE_CONST_WIDTH(val) \ { \ - .prop = LV_STYLE_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_MIN_WIDTH(val) \ { \ - .prop = LV_STYLE_MIN_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_MIN_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_MAX_WIDTH(val) \ { \ - .prop = LV_STYLE_MAX_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_MAX_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_HEIGHT(val) \ { \ - .prop = LV_STYLE_HEIGHT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_HEIGHT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_MIN_HEIGHT(val) \ { \ - .prop = LV_STYLE_MIN_HEIGHT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_MIN_HEIGHT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_MAX_HEIGHT(val) \ { \ - .prop = LV_STYLE_MAX_HEIGHT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_MAX_HEIGHT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_X(val) \ { \ - .prop = LV_STYLE_X, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_X, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_Y(val) \ { \ - .prop = LV_STYLE_Y, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_Y, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ALIGN(val) \ { \ - .prop = LV_STYLE_ALIGN, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ALIGN, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_WIDTH(val) \ { \ - .prop = LV_STYLE_TRANSFORM_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_HEIGHT(val) \ { \ - .prop = LV_STYLE_TRANSFORM_HEIGHT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_HEIGHT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSLATE_X(val) \ { \ - .prop = LV_STYLE_TRANSLATE_X, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSLATE_X, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSLATE_Y(val) \ { \ - .prop = LV_STYLE_TRANSLATE_Y, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSLATE_Y, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_ZOOM(val) \ { \ - .prop = LV_STYLE_TRANSFORM_ZOOM, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_ZOOM, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_ANGLE(val) \ { \ - .prop = LV_STYLE_TRANSFORM_ANGLE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_ANGLE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_PIVOT_X(val) \ { \ - .prop = LV_STYLE_TRANSFORM_PIVOT_X, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_PIVOT_X, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_PIVOT_Y(val) \ { \ - .prop = LV_STYLE_TRANSFORM_PIVOT_Y, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSFORM_PIVOT_Y, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_TOP(val) \ { \ - .prop = LV_STYLE_PAD_TOP, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_TOP, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_BOTTOM(val) \ { \ - .prop = LV_STYLE_PAD_BOTTOM, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_BOTTOM, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_LEFT(val) \ { \ - .prop = LV_STYLE_PAD_LEFT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_LEFT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_RIGHT(val) \ { \ - .prop = LV_STYLE_PAD_RIGHT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_RIGHT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_ROW(val) \ { \ - .prop = LV_STYLE_PAD_ROW, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_ROW, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_PAD_COLUMN(val) \ { \ - .prop = LV_STYLE_PAD_COLUMN, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_PAD_COLUMN, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_COLOR(val) \ { \ - .prop = LV_STYLE_BG_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_BG_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_BG_OPA(val) \ { \ - .prop = LV_STYLE_BG_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_GRAD_COLOR(val) \ { \ - .prop = LV_STYLE_BG_GRAD_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_BG_GRAD_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_BG_GRAD_DIR(val) \ { \ - .prop = LV_STYLE_BG_GRAD_DIR, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_GRAD_DIR, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_MAIN_STOP(val) \ { \ - .prop = LV_STYLE_BG_MAIN_STOP, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_MAIN_STOP, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_GRAD_STOP(val) \ { \ - .prop = LV_STYLE_BG_GRAD_STOP, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_GRAD_STOP, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_GRAD(val) \ { \ - .prop = LV_STYLE_BG_GRAD, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_BG_GRAD, .value = { .ptr = val } \ } #define LV_STYLE_CONST_BG_DITHER_MODE(val) \ { \ - .prop = LV_STYLE_BG_DITHER_MODE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_DITHER_MODE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_IMG_SRC(val) \ { \ - .prop = LV_STYLE_BG_IMG_SRC, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_BG_IMG_SRC, .value = { .ptr = val } \ } #define LV_STYLE_CONST_BG_IMG_OPA(val) \ { \ - .prop = LV_STYLE_BG_IMG_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_IMG_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_IMG_RECOLOR(val) \ { \ - .prop = LV_STYLE_BG_IMG_RECOLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_BG_IMG_RECOLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_BG_IMG_RECOLOR_OPA(val) \ { \ - .prop = LV_STYLE_BG_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BG_IMG_TILED(val) \ { \ - .prop = LV_STYLE_BG_IMG_TILED, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BG_IMG_TILED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BORDER_COLOR(val) \ { \ - .prop = LV_STYLE_BORDER_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_BORDER_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_BORDER_OPA(val) \ { \ - .prop = LV_STYLE_BORDER_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BORDER_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BORDER_WIDTH(val) \ { \ - .prop = LV_STYLE_BORDER_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BORDER_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BORDER_SIDE(val) \ { \ - .prop = LV_STYLE_BORDER_SIDE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BORDER_SIDE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BORDER_POST(val) \ { \ - .prop = LV_STYLE_BORDER_POST, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BORDER_POST, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_OUTLINE_WIDTH(val) \ { \ - .prop = LV_STYLE_OUTLINE_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_OUTLINE_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_OUTLINE_COLOR(val) \ { \ - .prop = LV_STYLE_OUTLINE_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_OUTLINE_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_OUTLINE_OPA(val) \ { \ - .prop = LV_STYLE_OUTLINE_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_OUTLINE_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_OUTLINE_PAD(val) \ { \ - .prop = LV_STYLE_OUTLINE_PAD, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_OUTLINE_PAD, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_WIDTH(val) \ { \ - .prop = LV_STYLE_SHADOW_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_OFS_X(val) \ { \ - .prop = LV_STYLE_SHADOW_OFS_X, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_OFS_X, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_OFS_Y(val) \ { \ - .prop = LV_STYLE_SHADOW_OFS_Y, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_OFS_Y, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_SPREAD(val) \ { \ - .prop = LV_STYLE_SHADOW_SPREAD, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_SPREAD, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_COLOR(val) \ { \ - .prop = LV_STYLE_SHADOW_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_SHADOW_OPA(val) \ { \ - .prop = LV_STYLE_SHADOW_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_SHADOW_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_IMG_OPA(val) \ { \ - .prop = LV_STYLE_IMG_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_IMG_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_IMG_RECOLOR(val) \ { \ - .prop = LV_STYLE_IMG_RECOLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_IMG_RECOLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_IMG_RECOLOR_OPA(val) \ { \ - .prop = LV_STYLE_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_WIDTH(val) \ { \ - .prop = LV_STYLE_LINE_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_DASH_WIDTH(val) \ { \ - .prop = LV_STYLE_LINE_DASH_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_DASH_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_DASH_GAP(val) \ { \ - .prop = LV_STYLE_LINE_DASH_GAP, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_DASH_GAP, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_ROUNDED(val) \ { \ - .prop = LV_STYLE_LINE_ROUNDED, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_ROUNDED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_COLOR(val) \ { \ - .prop = LV_STYLE_LINE_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_LINE_OPA(val) \ { \ - .prop = LV_STYLE_LINE_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LINE_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ARC_WIDTH(val) \ { \ - .prop = LV_STYLE_ARC_WIDTH, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ARC_WIDTH, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ARC_ROUNDED(val) \ { \ - .prop = LV_STYLE_ARC_ROUNDED, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ARC_ROUNDED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ARC_COLOR(val) \ { \ - .prop = LV_STYLE_ARC_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_ARC_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_ARC_OPA(val) \ { \ - .prop = LV_STYLE_ARC_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ARC_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ARC_IMG_SRC(val) \ { \ - .prop = LV_STYLE_ARC_IMG_SRC, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_ARC_IMG_SRC, .value = { .ptr = val } \ } #define LV_STYLE_CONST_TEXT_COLOR(val) \ { \ - .prop = LV_STYLE_TEXT_COLOR, .value = { .color = val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_COLOR, .value = { .color = val } \ } #define LV_STYLE_CONST_TEXT_OPA(val) \ { \ - .prop = LV_STYLE_TEXT_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TEXT_FONT(val) \ { \ - .prop = LV_STYLE_TEXT_FONT, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_FONT, .value = { .ptr = val } \ } #define LV_STYLE_CONST_TEXT_LETTER_SPACE(val) \ { \ - .prop = LV_STYLE_TEXT_LETTER_SPACE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_LETTER_SPACE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TEXT_LINE_SPACE(val) \ { \ - .prop = LV_STYLE_TEXT_LINE_SPACE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_LINE_SPACE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TEXT_DECOR(val) \ { \ - .prop = LV_STYLE_TEXT_DECOR, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_DECOR, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TEXT_ALIGN(val) \ { \ - .prop = LV_STYLE_TEXT_ALIGN, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_TEXT_ALIGN, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_RADIUS(val) \ { \ - .prop = LV_STYLE_RADIUS, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_RADIUS, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_CLIP_CORNER(val) \ { \ - .prop = LV_STYLE_CLIP_CORNER, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_CLIP_CORNER, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_OPA(val) \ { \ - .prop = LV_STYLE_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_COLOR_FILTER_DSC(val) \ { \ - .prop = LV_STYLE_COLOR_FILTER_DSC, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_COLOR_FILTER_DSC, .value = { .ptr = val } \ } #define LV_STYLE_CONST_COLOR_FILTER_OPA(val) \ { \ - .prop = LV_STYLE_COLOR_FILTER_OPA, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_COLOR_FILTER_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ANIM(val) \ { \ - .prop = LV_STYLE_ANIM, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_ANIM, .value = { .ptr = val } \ } #define LV_STYLE_CONST_ANIM_TIME(val) \ { \ - .prop = LV_STYLE_ANIM_TIME, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ANIM_TIME, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_ANIM_SPEED(val) \ { \ - .prop = LV_STYLE_ANIM_SPEED, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_ANIM_SPEED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSITION(val) \ { \ - .prop = LV_STYLE_TRANSITION, .value = { .ptr = val } \ + .prop_ptr = &lv_style_const_prop_id_TRANSITION, .value = { .ptr = val } \ } #define LV_STYLE_CONST_BLEND_MODE(val) \ { \ - .prop = LV_STYLE_BLEND_MODE, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BLEND_MODE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LAYOUT(val) \ { \ - .prop = LV_STYLE_LAYOUT, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_LAYOUT, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BASE_DIR(val) \ { \ - .prop = LV_STYLE_BASE_DIR, .value = { .num = (int32_t)val } \ + .prop_ptr = &lv_style_const_prop_id_BASE_DIR, .value = { .num = (int32_t)val } \ } diff --git a/tests/src/test_cases/test_style.c b/tests/src/test_cases/test_style.c index 76c1724d1..c75800d76 100644 --- a/tests/src/test_cases/test_style.c +++ b/tests/src/test_cases/test_style.c @@ -106,4 +106,20 @@ void test_inherit_meta_with_lower_precedence_style(void) TEST_ASSERT_EQUAL_HEX(lv_color_hex(0xff0000).full, lv_obj_get_style_text_color(grandchild, LV_PART_MAIN).full); } +const lv_style_const_prop_t const_style_props[] = { + LV_STYLE_CONST_WIDTH(51), + LV_STYLE_CONST_HEIGHT(50), + LV_STYLE_CONST_PROPS_END +}; + +LV_STYLE_CONST_INIT(const_style, const_style_props); + +void test_const_style(void) +{ + lv_obj_t * obj = lv_obj_create(lv_scr_act()); + lv_obj_add_style(obj, &const_style, LV_PART_MAIN); + TEST_ASSERT_EQUAL(51, lv_obj_get_style_width(obj, LV_PART_MAIN)); + TEST_ASSERT_EQUAL(50, lv_obj_get_style_height(obj, LV_PART_MAIN)); +} + #endif