diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py index 6576d6ddc..541f3e8ac 100755 --- a/scripts/style_api_gen.py +++ b/scripts/style_api_gen.py @@ -388,6 +388,17 @@ def local_style_set(p): print("}") print("") +def style_const_set(p): + cast = style_set_cast(p['style_type']) + print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\") + print(" { \\") + print(" .prop = LV_STYLE_" + p['name'] + ", \\") + print(" .value = { \\") + print(" ." + p['style_type'] +" = " + cast + "val \\") + print(" } \\") + print(" }") + print("") + def docs(p): @@ -430,6 +441,7 @@ sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w') for p in props: style_set(p) + style_const_set(p) sys.stdout = open(base_dir + '/style_props.md', 'w') diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c index 0d11f6773..e77f5881d 100644 --- a/src/misc/lv_style.c +++ b/src/misc/lv_style.c @@ -55,6 +55,11 @@ void lv_style_reset(lv_style_t * style) { LV_ASSERT_STYLE(style); + if(style->is_const) { + LV_LOG_ERROR("Cannot reset const style"); + return; + } + if(style->prop_cnt > 1) lv_mem_free(style->v_p.values_and_props); lv_memset_00(style, sizeof(lv_style_t)); #if LV_USE_ASSERT_STYLE @@ -74,6 +79,11 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) { LV_ASSERT_STYLE(style); + if(style->is_const) { + LV_LOG_ERROR("Cannot remove prop from const style"); + return false; + } + if(style->prop_cnt == 0) return false; if(style->prop_cnt == 1) { @@ -92,10 +102,11 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) if(old_props[i] == prop) { lv_style_value_t * old_values = (lv_style_value_t *)style->v_p.values_and_props; - uint16_t * new_props = &style->prop1; - lv_style_value_t * new_values = &style->v_p.value1; - - if(style->prop_cnt > 2) { + if(style->prop_cnt == 2) { + style->prop_cnt = 1; + style->prop1 = i == 0 ? old_props[1] : old_props[0]; + style->v_p.value1 = i == 0 ? old_values[1] : old_values[0]; + } else { size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); uint8_t * new_values_and_props = lv_mem_alloc(size); if(new_values_and_props == NULL) return false; @@ -103,19 +114,15 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) style->prop_cnt--; tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - new_props = (uint16_t *)tmp; - new_values = (lv_style_value_t *)new_values_and_props; - } else { - style->prop_cnt = 1; - style->prop1 = i == 0 ? old_props[1] : old_props[0]; - style->v_p.value1 = i == 0 ? old_values[1] : old_values[0]; - } + uint16_t * new_props = (uint16_t *)tmp; + lv_style_value_t * new_values = (lv_style_value_t *)new_values_and_props; - uint32_t j; - for(i = j = 0; j <= style->prop_cnt; j++) { /*<=: because prop_cnt already reduced but all the old props. needs to be checked.*/ - if(old_props[j] != prop) { - new_values[i] = old_values[j]; - new_props[i++] = old_props[j]; + uint32_t j; + for(i = j = 0; j <= style->prop_cnt; j++) { /*<=: because prop_cnt already reduced but all the old props. needs to be checked.*/ + if(old_props[j] != prop) { + new_values[i] = old_values[j]; + new_props[i++] = old_props[j]; + } } } @@ -131,6 +138,11 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_ { LV_ASSERT_STYLE(style); + if(style->is_const) { + LV_LOG_ERROR("Cannot set property of constant style"); + return; + } + if(style->prop_cnt > 1) { uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); uint16_t * props = (uint16_t *)tmp; diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h index e53dd07db..1fff85e61 100644 --- a/src/misc/lv_style.h +++ b/src/misc/lv_style.h @@ -43,6 +43,12 @@ extern "C" { #define LV_IMG_ZOOM_NONE 256 /*Value for not zooming the image*/ LV_EXPORT_CONST_INT(LV_IMG_ZOOM_NONE); +#if LV_USE_ASSERT_STYLE +#define LV_STYLE_CONST_INIT(var_name, prop_array) const lv_style_t var_name = { .sentinel = LV_STYLE_SENTINEL_VALUE, .v_p = { .const_props = prop_array }, .has_group = 0xFF, .is_const = 1 } +#else +#define LV_STYLE_CONST_INIT(var_name, prop_array) const lv_style_t var_name = { .v_p = { .const_props = prop_array }, .has_group = 0xFF, .is_const = 1 } +#endif + /********************** * TYPEDEFS **********************/ @@ -236,6 +242,14 @@ typedef struct _lv_style_transiton_t { uint32_t delay; /**< Delay before the transition in [ms]*/ }lv_style_transition_dsc_t; + +/** + * Descriptor of a constant style property. + */ +typedef struct { + lv_style_prop_t prop; + lv_style_value_t value; +} lv_style_const_prop_t; /** * Descriptor of a style (a collection of properties and values). */ @@ -250,9 +264,11 @@ typedef struct { union { lv_style_value_t value1; uint8_t * values_and_props; + const lv_style_const_prop_t * const_props; } v_p; - uint16_t prop1; + uint16_t prop1 :15; + uint16_t is_const :1; uint8_t has_group; uint8_t prop_cnt; } lv_style_t; @@ -334,6 +350,17 @@ lv_res_t lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_va */ static inline lv_res_t lv_style_get_prop_inlined(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) { + if(style->is_const) { + 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++) { + if(const_prop->prop == prop) { + *value = const_prop->value; + return LV_RES_OK; + } + } + return LV_RES_INV; + } + if(style->prop_cnt == 0) return LV_RES_INV; if(style->prop_cnt > 1) { diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h index ff78a282f..6e198d9f6 100644 --- a/src/misc/lv_style_gen.h +++ b/src/misc/lv_style_gen.h @@ -6,6 +6,14 @@ static inline void lv_style_set_radius(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_RADIUS, v); } +#define LV_STYLE_CONST_RADIUS(val) \ + { \ + .prop = LV_STYLE_RADIUS, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_clip_corner(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -14,6 +22,14 @@ static inline void lv_style_set_clip_corner(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_CLIP_CORNER, v); } +#define LV_STYLE_CONST_CLIP_CORNER(val) \ + { \ + .prop = LV_STYLE_CLIP_CORNER, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -22,6 +38,14 @@ static inline void lv_style_set_transform_width(lv_style_t * style, lv_coord_t v lv_style_set_prop(style, LV_STYLE_TRANSFORM_WIDTH, v); } +#define LV_STYLE_CONST_TRANSFORM_WIDTH(val) \ + { \ + .prop = LV_STYLE_TRANSFORM_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -30,6 +54,14 @@ static inline void lv_style_set_transform_height(lv_style_t * style, lv_coord_t lv_style_set_prop(style, LV_STYLE_TRANSFORM_HEIGHT, v); } +#define LV_STYLE_CONST_TRANSFORM_HEIGHT(val) \ + { \ + .prop = LV_STYLE_TRANSFORM_HEIGHT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -38,6 +70,14 @@ static inline void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value lv_style_set_prop(style, LV_STYLE_TRANSLATE_X, v); } +#define LV_STYLE_CONST_TRANSLATE_X(val) \ + { \ + .prop = LV_STYLE_TRANSLATE_X, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -46,6 +86,14 @@ static inline void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value lv_style_set_prop(style, LV_STYLE_TRANSLATE_Y, v); } +#define LV_STYLE_CONST_TRANSLATE_Y(val) \ + { \ + .prop = LV_STYLE_TRANSLATE_Y, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -54,6 +102,14 @@ static inline void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t va lv_style_set_prop(style, LV_STYLE_TRANSFORM_ZOOM, v); } +#define LV_STYLE_CONST_TRANSFORM_ZOOM(val) \ + { \ + .prop = LV_STYLE_TRANSFORM_ZOOM, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -62,6 +118,14 @@ static inline void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t v lv_style_set_prop(style, LV_STYLE_TRANSFORM_ANGLE, v); } +#define LV_STYLE_CONST_TRANSFORM_ANGLE(val) \ + { \ + .prop = LV_STYLE_TRANSFORM_ANGLE, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -70,6 +134,14 @@ static inline void lv_style_set_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_OPA, v); } +#define LV_STYLE_CONST_OPA(val) \ + { \ + .prop = LV_STYLE_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value) { lv_style_value_t v = { @@ -78,6 +150,14 @@ static inline void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_co lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_DSC, v); } +#define LV_STYLE_CONST_COLOR_FILTER_DSC(val) \ + { \ + .prop = LV_STYLE_COLOR_FILTER_DSC, \ + .value = { \ + .ptr = val \ + } \ + } + static inline void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -86,6 +166,14 @@ static inline void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t va lv_style_set_prop(style, LV_STYLE_COLOR_FILTER_OPA, v); } +#define LV_STYLE_CONST_COLOR_FILTER_OPA(val) \ + { \ + .prop = LV_STYLE_COLOR_FILTER_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_anim_time(lv_style_t * style, uint32_t value) { lv_style_value_t v = { @@ -94,6 +182,14 @@ static inline void lv_style_set_anim_time(lv_style_t * style, uint32_t value) lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v); } +#define LV_STYLE_CONST_ANIM_TIME(val) \ + { \ + .prop = LV_STYLE_ANIM_TIME, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_anim_speed(lv_style_t * style, uint32_t value) { lv_style_value_t v = { @@ -102,6 +198,14 @@ static inline void lv_style_set_anim_speed(lv_style_t * style, uint32_t value) lv_style_set_prop(style, LV_STYLE_ANIM_SPEED, v); } +#define LV_STYLE_CONST_ANIM_SPEED(val) \ + { \ + .prop = LV_STYLE_ANIM_SPEED, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value) { lv_style_value_t v = { @@ -110,6 +214,14 @@ static inline void lv_style_set_transition(lv_style_t * style, const lv_style_tr lv_style_set_prop(style, LV_STYLE_TRANSITION, v); } +#define LV_STYLE_CONST_TRANSITION(val) \ + { \ + .prop = LV_STYLE_TRANSITION, \ + .value = { \ + .ptr = val \ + } \ + } + static inline void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value) { lv_style_value_t v = { @@ -118,6 +230,14 @@ static inline void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t v lv_style_set_prop(style, LV_STYLE_BLEND_MODE, v); } +#define LV_STYLE_CONST_BLEND_MODE(val) \ + { \ + .prop = LV_STYLE_BLEND_MODE, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -126,6 +246,14 @@ static inline void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_TOP, v); } +#define LV_STYLE_CONST_PAD_TOP(val) \ + { \ + .prop = LV_STYLE_PAD_TOP, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -134,6 +262,14 @@ static inline void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_BOTTOM, v); } +#define LV_STYLE_CONST_PAD_BOTTOM(val) \ + { \ + .prop = LV_STYLE_PAD_BOTTOM, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -142,6 +278,14 @@ static inline void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_LEFT, v); } +#define LV_STYLE_CONST_PAD_LEFT(val) \ + { \ + .prop = LV_STYLE_PAD_LEFT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -150,6 +294,14 @@ static inline void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_RIGHT, v); } +#define LV_STYLE_CONST_PAD_RIGHT(val) \ + { \ + .prop = LV_STYLE_PAD_RIGHT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -158,6 +310,14 @@ static inline void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_ROW, v); } +#define LV_STYLE_CONST_PAD_ROW(val) \ + { \ + .prop = LV_STYLE_PAD_ROW, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -166,6 +326,14 @@ static inline void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_PAD_COLUMN, v); } +#define LV_STYLE_CONST_PAD_COLUMN(val) \ + { \ + .prop = LV_STYLE_PAD_COLUMN, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -174,6 +342,14 @@ static inline void lv_style_set_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_WIDTH, v); } +#define LV_STYLE_CONST_WIDTH(val) \ + { \ + .prop = LV_STYLE_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -182,6 +358,14 @@ static inline void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MIN_WIDTH, v); } +#define LV_STYLE_CONST_MIN_WIDTH(val) \ + { \ + .prop = LV_STYLE_MIN_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_max_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -190,6 +374,14 @@ static inline void lv_style_set_max_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MAX_WIDTH, v); } +#define LV_STYLE_CONST_MAX_WIDTH(val) \ + { \ + .prop = LV_STYLE_MAX_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -198,6 +390,14 @@ static inline void lv_style_set_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_HEIGHT, v); } +#define LV_STYLE_CONST_HEIGHT(val) \ + { \ + .prop = LV_STYLE_HEIGHT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_min_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -206,6 +406,14 @@ static inline void lv_style_set_min_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MIN_HEIGHT, v); } +#define LV_STYLE_CONST_MIN_HEIGHT(val) \ + { \ + .prop = LV_STYLE_MIN_HEIGHT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_max_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -214,6 +422,14 @@ static inline void lv_style_set_max_height(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_MAX_HEIGHT, v); } +#define LV_STYLE_CONST_MAX_HEIGHT(val) \ + { \ + .prop = LV_STYLE_MAX_HEIGHT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -222,6 +438,14 @@ static inline void lv_style_set_x(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_X, v); } +#define LV_STYLE_CONST_X(val) \ + { \ + .prop = LV_STYLE_X, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -230,6 +454,14 @@ static inline void lv_style_set_y(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_Y, v); } +#define LV_STYLE_CONST_Y(val) \ + { \ + .prop = LV_STYLE_Y, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_align(lv_style_t * style, lv_align_t value) { lv_style_value_t v = { @@ -238,6 +470,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); } +#define LV_STYLE_CONST_ALIGN(val) \ + { \ + .prop = LV_STYLE_ALIGN, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_layout(lv_style_t * style, uint16_t value) { lv_style_value_t v = { @@ -246,6 +486,14 @@ static inline void lv_style_set_layout(lv_style_t * style, uint16_t value) lv_style_set_prop(style, LV_STYLE_LAYOUT, v); } +#define LV_STYLE_CONST_LAYOUT(val) \ + { \ + .prop = LV_STYLE_LAYOUT, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -254,6 +502,14 @@ static inline void lv_style_set_bg_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_BG_COLOR, v); } +#define LV_STYLE_CONST_BG_COLOR(val) \ + { \ + .prop = LV_STYLE_BG_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -262,6 +518,14 @@ static inline void lv_style_set_bg_color_filtered(lv_style_t * style, lv_color_t lv_style_set_prop(style, LV_STYLE_BG_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_BG_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_BG_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -270,6 +534,14 @@ static inline void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BG_OPA, v); } +#define LV_STYLE_CONST_BG_OPA(val) \ + { \ + .prop = LV_STYLE_BG_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -278,6 +550,14 @@ static inline void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t val lv_style_set_prop(style, LV_STYLE_BG_GRAD_COLOR, v); } +#define LV_STYLE_CONST_BG_GRAD_COLOR(val) \ + { \ + .prop = LV_STYLE_BG_GRAD_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_grad_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -286,6 +566,14 @@ static inline void lv_style_set_bg_grad_color_filtered(lv_style_t * style, lv_co lv_style_set_prop(style, LV_STYLE_BG_GRAD_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_BG_GRAD_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_BG_GRAD_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value) { lv_style_value_t v = { @@ -294,6 +582,14 @@ static inline void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t va lv_style_set_prop(style, LV_STYLE_BG_GRAD_DIR, v); } +#define LV_STYLE_CONST_BG_GRAD_DIR(val) \ + { \ + .prop = LV_STYLE_BG_GRAD_DIR, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -302,6 +598,14 @@ static inline void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_BG_MAIN_STOP, v); } +#define LV_STYLE_CONST_BG_MAIN_STOP(val) \ + { \ + .prop = LV_STYLE_BG_MAIN_STOP, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -310,6 +614,14 @@ static inline void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_BG_GRAD_STOP, v); } +#define LV_STYLE_CONST_BG_GRAD_STOP(val) \ + { \ + .prop = LV_STYLE_BG_GRAD_STOP, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { @@ -318,6 +630,14 @@ static inline void lv_style_set_bg_img_src(lv_style_t * style, const void * valu lv_style_set_prop(style, LV_STYLE_BG_IMG_SRC, v); } +#define LV_STYLE_CONST_BG_IMG_SRC(val) \ + { \ + .prop = LV_STYLE_BG_IMG_SRC, \ + .value = { \ + .ptr = val \ + } \ + } + static inline void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -326,6 +646,14 @@ static inline 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); } +#define LV_STYLE_CONST_BG_IMG_OPA(val) \ + { \ + .prop = LV_STYLE_BG_IMG_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -334,6 +662,14 @@ static inline void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t va lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR, v); } +#define LV_STYLE_CONST_BG_IMG_RECOLOR(val) \ + { \ + .prop = LV_STYLE_BG_IMG_RECOLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_img_recolor_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -342,6 +678,14 @@ static inline void lv_style_set_bg_img_recolor_filtered(lv_style_t * style, lv_c lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_FILTERED, v); } +#define LV_STYLE_CONST_BG_IMG_RECOLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_BG_IMG_RECOLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -350,6 +694,14 @@ static inline void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_OPA, v); } +#define LV_STYLE_CONST_BG_IMG_RECOLOR_OPA(val) \ + { \ + .prop = LV_STYLE_BG_IMG_RECOLOR_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -358,6 +710,14 @@ static inline void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_BG_IMG_TILED, v); } +#define LV_STYLE_CONST_BG_IMG_TILED(val) \ + { \ + .prop = LV_STYLE_BG_IMG_TILED, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_border_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -366,6 +726,14 @@ static inline void lv_style_set_border_color(lv_style_t * style, lv_color_t valu lv_style_set_prop(style, LV_STYLE_BORDER_COLOR, v); } +#define LV_STYLE_CONST_BORDER_COLOR(val) \ + { \ + .prop = LV_STYLE_BORDER_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_border_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -374,6 +742,14 @@ static inline void lv_style_set_border_color_filtered(lv_style_t * style, lv_col lv_style_set_prop(style, LV_STYLE_BORDER_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_BORDER_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_BORDER_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -382,6 +758,14 @@ static inline void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BORDER_OPA, v); } +#define LV_STYLE_CONST_BORDER_OPA(val) \ + { \ + .prop = LV_STYLE_BORDER_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_border_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -390,6 +774,14 @@ static inline void lv_style_set_border_width(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_BORDER_WIDTH, v); } +#define LV_STYLE_CONST_BORDER_WIDTH(val) \ + { \ + .prop = LV_STYLE_BORDER_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_border_side(lv_style_t * style, lv_border_side_t value) { lv_style_value_t v = { @@ -398,6 +790,14 @@ static inline void lv_style_set_border_side(lv_style_t * style, lv_border_side_t lv_style_set_prop(style, LV_STYLE_BORDER_SIDE, v); } +#define LV_STYLE_CONST_BORDER_SIDE(val) \ + { \ + .prop = LV_STYLE_BORDER_SIDE, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_border_post(lv_style_t * style, bool value) { lv_style_value_t v = { @@ -406,6 +806,14 @@ static inline void lv_style_set_border_post(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_BORDER_POST, v); } +#define LV_STYLE_CONST_BORDER_POST(val) \ + { \ + .prop = LV_STYLE_BORDER_POST, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_text_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -414,6 +822,14 @@ static inline void lv_style_set_text_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_TEXT_COLOR, v); } +#define LV_STYLE_CONST_TEXT_COLOR(val) \ + { \ + .prop = LV_STYLE_TEXT_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_text_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -422,6 +838,14 @@ static inline void lv_style_set_text_color_filtered(lv_style_t * style, lv_color lv_style_set_prop(style, LV_STYLE_TEXT_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_TEXT_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_TEXT_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -430,6 +854,14 @@ static inline void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_TEXT_OPA, v); } +#define LV_STYLE_CONST_TEXT_OPA(val) \ + { \ + .prop = LV_STYLE_TEXT_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value) { lv_style_value_t v = { @@ -438,6 +870,14 @@ static inline void lv_style_set_text_font(lv_style_t * style, const lv_font_t * lv_style_set_prop(style, LV_STYLE_TEXT_FONT, v); } +#define LV_STYLE_CONST_TEXT_FONT(val) \ + { \ + .prop = LV_STYLE_TEXT_FONT, \ + .value = { \ + .ptr = val \ + } \ + } + static inline void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -446,6 +886,14 @@ static inline void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t lv_style_set_prop(style, LV_STYLE_TEXT_LETTER_SPACE, v); } +#define LV_STYLE_CONST_TEXT_LETTER_SPACE(val) \ + { \ + .prop = LV_STYLE_TEXT_LETTER_SPACE, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -454,6 +902,14 @@ static inline void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t v lv_style_set_prop(style, LV_STYLE_TEXT_LINE_SPACE, v); } +#define LV_STYLE_CONST_TEXT_LINE_SPACE(val) \ + { \ + .prop = LV_STYLE_TEXT_LINE_SPACE, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value) { lv_style_value_t v = { @@ -462,6 +918,14 @@ static inline void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t v lv_style_set_prop(style, LV_STYLE_TEXT_DECOR, v); } +#define LV_STYLE_CONST_TEXT_DECOR(val) \ + { \ + .prop = LV_STYLE_TEXT_DECOR, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value) { lv_style_value_t v = { @@ -470,6 +934,14 @@ static inline void lv_style_set_text_align(lv_style_t * style, lv_text_align_t v lv_style_set_prop(style, LV_STYLE_TEXT_ALIGN, v); } +#define LV_STYLE_CONST_TEXT_ALIGN(val) \ + { \ + .prop = LV_STYLE_TEXT_ALIGN, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -478,6 +950,14 @@ static inline void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_IMG_OPA, v); } +#define LV_STYLE_CONST_IMG_OPA(val) \ + { \ + .prop = LV_STYLE_IMG_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -486,6 +966,14 @@ static inline void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR, v); } +#define LV_STYLE_CONST_IMG_RECOLOR(val) \ + { \ + .prop = LV_STYLE_IMG_RECOLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_img_recolor_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -494,6 +982,14 @@ static inline void lv_style_set_img_recolor_filtered(lv_style_t * style, lv_colo lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR_FILTERED, v); } +#define LV_STYLE_CONST_IMG_RECOLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_IMG_RECOLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -502,6 +998,14 @@ static inline void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t val lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR_OPA, v); } +#define LV_STYLE_CONST_IMG_RECOLOR_OPA(val) \ + { \ + .prop = LV_STYLE_IMG_RECOLOR_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -510,6 +1014,14 @@ static inline void lv_style_set_outline_width(lv_style_t * style, lv_coord_t val lv_style_set_prop(style, LV_STYLE_OUTLINE_WIDTH, v); } +#define LV_STYLE_CONST_OUTLINE_WIDTH(val) \ + { \ + .prop = LV_STYLE_OUTLINE_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_outline_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -518,6 +1030,14 @@ static inline void lv_style_set_outline_color(lv_style_t * style, lv_color_t val lv_style_set_prop(style, LV_STYLE_OUTLINE_COLOR, v); } +#define LV_STYLE_CONST_OUTLINE_COLOR(val) \ + { \ + .prop = LV_STYLE_OUTLINE_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_outline_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -526,6 +1046,14 @@ static inline void lv_style_set_outline_color_filtered(lv_style_t * style, lv_co lv_style_set_prop(style, LV_STYLE_OUTLINE_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_OUTLINE_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_OUTLINE_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -534,6 +1062,14 @@ static inline void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_OPA, v); } +#define LV_STYLE_CONST_OUTLINE_OPA(val) \ + { \ + .prop = LV_STYLE_OUTLINE_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -542,6 +1078,14 @@ static inline void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value lv_style_set_prop(style, LV_STYLE_OUTLINE_PAD, v); } +#define LV_STYLE_CONST_OUTLINE_PAD(val) \ + { \ + .prop = LV_STYLE_OUTLINE_PAD, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -550,6 +1094,14 @@ static inline void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_SHADOW_WIDTH, v); } +#define LV_STYLE_CONST_SHADOW_WIDTH(val) \ + { \ + .prop = LV_STYLE_SHADOW_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -558,6 +1110,14 @@ static inline void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_X, v); } +#define LV_STYLE_CONST_SHADOW_OFS_X(val) \ + { \ + .prop = LV_STYLE_SHADOW_OFS_X, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -566,6 +1126,14 @@ static inline void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_Y, v); } +#define LV_STYLE_CONST_SHADOW_OFS_Y(val) \ + { \ + .prop = LV_STYLE_SHADOW_OFS_Y, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -574,6 +1142,14 @@ static inline void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t val lv_style_set_prop(style, LV_STYLE_SHADOW_SPREAD, v); } +#define LV_STYLE_CONST_SHADOW_SPREAD(val) \ + { \ + .prop = LV_STYLE_SHADOW_SPREAD, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -582,6 +1158,14 @@ static inline void lv_style_set_shadow_color(lv_style_t * style, lv_color_t valu lv_style_set_prop(style, LV_STYLE_SHADOW_COLOR, v); } +#define LV_STYLE_CONST_SHADOW_COLOR(val) \ + { \ + .prop = LV_STYLE_SHADOW_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_shadow_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -590,6 +1174,14 @@ static inline void lv_style_set_shadow_color_filtered(lv_style_t * style, lv_col lv_style_set_prop(style, LV_STYLE_SHADOW_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_SHADOW_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_SHADOW_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -598,6 +1190,14 @@ static inline void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_OPA, v); } +#define LV_STYLE_CONST_SHADOW_OPA(val) \ + { \ + .prop = LV_STYLE_SHADOW_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -606,6 +1206,14 @@ static inline void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_LINE_WIDTH, v); } +#define LV_STYLE_CONST_LINE_WIDTH(val) \ + { \ + .prop = LV_STYLE_LINE_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -614,6 +1222,14 @@ static inline void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t v lv_style_set_prop(style, LV_STYLE_LINE_DASH_WIDTH, v); } +#define LV_STYLE_CONST_LINE_DASH_WIDTH(val) \ + { \ + .prop = LV_STYLE_LINE_DASH_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -622,6 +1238,14 @@ static inline void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t val lv_style_set_prop(style, LV_STYLE_LINE_DASH_GAP, v); } +#define LV_STYLE_CONST_LINE_DASH_GAP(val) \ + { \ + .prop = LV_STYLE_LINE_DASH_GAP, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_line_rounded(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -630,6 +1254,14 @@ static inline void lv_style_set_line_rounded(lv_style_t * style, lv_coord_t valu lv_style_set_prop(style, LV_STYLE_LINE_ROUNDED, v); } +#define LV_STYLE_CONST_LINE_ROUNDED(val) \ + { \ + .prop = LV_STYLE_LINE_ROUNDED, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_line_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -638,6 +1270,14 @@ static inline void lv_style_set_line_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_LINE_COLOR, v); } +#define LV_STYLE_CONST_LINE_COLOR(val) \ + { \ + .prop = LV_STYLE_LINE_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_line_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -646,6 +1286,14 @@ static inline void lv_style_set_line_color_filtered(lv_style_t * style, lv_color lv_style_set_prop(style, LV_STYLE_LINE_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_LINE_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_LINE_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -654,6 +1302,14 @@ static inline void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_LINE_OPA, v); } +#define LV_STYLE_CONST_LINE_OPA(val) \ + { \ + .prop = LV_STYLE_LINE_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -662,6 +1318,14 @@ static inline void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value) lv_style_set_prop(style, LV_STYLE_ARC_WIDTH, v); } +#define LV_STYLE_CONST_ARC_WIDTH(val) \ + { \ + .prop = LV_STYLE_ARC_WIDTH, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_arc_rounded(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { @@ -670,6 +1334,14 @@ static inline void lv_style_set_arc_rounded(lv_style_t * style, lv_coord_t value lv_style_set_prop(style, LV_STYLE_ARC_ROUNDED, v); } +#define LV_STYLE_CONST_ARC_ROUNDED(val) \ + { \ + .prop = LV_STYLE_ARC_ROUNDED, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_arc_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -678,6 +1350,14 @@ static inline void lv_style_set_arc_color(lv_style_t * style, lv_color_t value) lv_style_set_prop(style, LV_STYLE_ARC_COLOR, v); } +#define LV_STYLE_CONST_ARC_COLOR(val) \ + { \ + .prop = LV_STYLE_ARC_COLOR, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_arc_color_filtered(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -686,6 +1366,14 @@ static inline void lv_style_set_arc_color_filtered(lv_style_t * style, lv_color_ lv_style_set_prop(style, LV_STYLE_ARC_COLOR_FILTERED, v); } +#define LV_STYLE_CONST_ARC_COLOR_FILTERED(val) \ + { \ + .prop = LV_STYLE_ARC_COLOR_FILTERED, \ + .value = { \ + .color = val \ + } \ + } + static inline void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { @@ -694,6 +1382,14 @@ static inline void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_ARC_OPA, v); } +#define LV_STYLE_CONST_ARC_OPA(val) \ + { \ + .prop = LV_STYLE_ARC_OPA, \ + .value = { \ + .num = (int32_t)val \ + } \ + } + static inline void lv_style_set_arc_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { @@ -702,3 +1398,11 @@ static inline void lv_style_set_arc_img_src(lv_style_t * style, const void * val lv_style_set_prop(style, LV_STYLE_ARC_IMG_SRC, v); } +#define LV_STYLE_CONST_ARC_IMG_SRC(val) \ + { \ + .prop = LV_STYLE_ARC_IMG_SRC, \ + .value = { \ + .ptr = val \ + } \ + } +