Lines Matching refs:style
27 static void lv_style_set_prop_internal(lv_style_t * style, lv_style_prop_t prop_and_meta, lv_style_…
151 void lv_style_init(lv_style_t * style) in lv_style_init() argument
154 if(style->sentinel == LV_STYLE_SENTINEL_VALUE && style->prop_cnt > 1) { in lv_style_init()
159 lv_memset_00(style, sizeof(lv_style_t)); in lv_style_init()
161 style->sentinel = LV_STYLE_SENTINEL_VALUE; in lv_style_init()
165 void lv_style_reset(lv_style_t * style) in lv_style_reset() argument
167 LV_ASSERT_STYLE(style); in lv_style_reset()
169 if(style->prop1 == LV_STYLE_PROP_ANY) { in lv_style_reset()
174 if(style->prop_cnt > 1) lv_mem_free(style->v_p.values_and_props); in lv_style_reset()
175 lv_memset_00(style, sizeof(lv_style_t)); in lv_style_reset()
177 style->sentinel = LV_STYLE_SENTINEL_VALUE; in lv_style_reset()
222 bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) in lv_style_remove_prop() argument
224 LV_ASSERT_STYLE(style); in lv_style_remove_prop()
226 if(style->prop1 == LV_STYLE_PROP_ANY) { in lv_style_remove_prop()
231 if(style->prop_cnt == 0) return false; in lv_style_remove_prop()
233 if(style->prop_cnt == 1) { in lv_style_remove_prop()
234 if(LV_STYLE_PROP_ID_MASK(style->prop1) == prop) { in lv_style_remove_prop()
235 style->prop1 = LV_STYLE_PROP_INV; in lv_style_remove_prop()
236 style->prop_cnt = 0; in lv_style_remove_prop()
242 uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_remove_prop()
245 for(i = 0; i < style->prop_cnt; i++) { in lv_style_remove_prop()
247 lv_style_value_t * old_values = (lv_style_value_t *)style->v_p.values_and_props; in lv_style_remove_prop()
249 if(style->prop_cnt == 2) { in lv_style_remove_prop()
250 style->prop_cnt = 1; in lv_style_remove_prop()
251 style->prop1 = i == 0 ? old_props[1] : old_props[0]; in lv_style_remove_prop()
252 style->v_p.value1 = i == 0 ? old_values[1] : old_values[0]; in lv_style_remove_prop()
255 size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); in lv_style_remove_prop()
258 style->v_p.values_and_props = new_values_and_props; in lv_style_remove_prop()
259 style->prop_cnt--; in lv_style_remove_prop()
261 tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_remove_prop()
266 for(i = j = 0; j <= style->prop_cnt; in lv_style_remove_prop()
283 void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value) in lv_style_set_prop() argument
285 lv_style_set_prop_internal(style, prop, value, lv_style_set_prop_helper); in lv_style_set_prop()
288 void lv_style_set_prop_meta(lv_style_t * style, lv_style_prop_t prop, uint16_t meta) in lv_style_set_prop_meta() argument
290 lv_style_set_prop_internal(style, prop | meta, null_style_value, lv_style_set_prop_meta_helper); in lv_style_set_prop_meta()
293 lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t *… in lv_style_get_prop() argument
295 return lv_style_get_prop_inlined(style, prop, value); in lv_style_get_prop()
367 bool lv_style_is_empty(const lv_style_t * style) in lv_style_is_empty() argument
369 LV_ASSERT_STYLE(style); in lv_style_is_empty()
371 return style->prop_cnt == 0 ? true : false; in lv_style_is_empty()
415 static void lv_style_set_prop_internal(lv_style_t * style, lv_style_prop_t prop_and_meta, lv_style_… in lv_style_set_prop_internal() argument
418 LV_ASSERT_STYLE(style); in lv_style_set_prop_internal()
420 if(style->prop1 == LV_STYLE_PROP_ANY) { in lv_style_set_prop_internal()
427 if(style->prop_cnt > 1) { in lv_style_set_prop_internal()
428 uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_set_prop_internal()
431 for(i = style->prop_cnt - 1; i >= 0; i--) { in lv_style_set_prop_internal()
433 lv_style_value_t * values = (lv_style_value_t *)style->v_p.values_and_props; in lv_style_set_prop_internal()
439 size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); in lv_style_set_prop_internal()
440 uint8_t * values_and_props = lv_mem_realloc(style->v_p.values_and_props, size); in lv_style_set_prop_internal()
442 style->v_p.values_and_props = values_and_props; in lv_style_set_prop_internal()
444 tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_set_prop_internal()
447 for(i = style->prop_cnt - 1; i >= 0; i--) { in lv_style_set_prop_internal()
450 style->prop_cnt++; in lv_style_set_prop_internal()
453 tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_set_prop_internal()
458 …value_adjustment_helper(prop_and_meta, value, &props[style->prop_cnt - 1], &values[style->prop_cnt… in lv_style_set_prop_internal()
460 else if(style->prop_cnt == 1) { in lv_style_set_prop_internal()
461 if(LV_STYLE_PROP_ID_MASK(style->prop1) == prop_id) { in lv_style_set_prop_internal()
462 value_adjustment_helper(prop_and_meta, value, &style->prop1, &style->v_p.value1); in lv_style_set_prop_internal()
465 size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); in lv_style_set_prop_internal()
468 lv_style_value_t value_tmp = style->v_p.value1; in lv_style_set_prop_internal()
469 style->v_p.values_and_props = values_and_props; in lv_style_set_prop_internal()
470 style->prop_cnt++; in lv_style_set_prop_internal()
472 uint8_t * tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); in lv_style_set_prop_internal()
475 props[0] = style->prop1; in lv_style_set_prop_internal()
480 style->prop_cnt = 1; in lv_style_set_prop_internal()
481 value_adjustment_helper(prop_and_meta, value, &style->prop1, &style->v_p.value1); in lv_style_set_prop_internal()
485 style->has_group |= 1 << group; in lv_style_set_prop_internal()