Lines Matching refs:ext
89 lv_bar_ext_t * ext = lv_obj_allocate_ext_attr(bar, sizeof(lv_bar_ext_t)); in lv_bar_create() local
90 LV_ASSERT_MEM(ext); in lv_bar_create()
91 if(ext == NULL) { in lv_bar_create()
96 ext->min_value = 0; in lv_bar_create()
97 ext->start_value = 0; in lv_bar_create()
98 ext->max_value = 100; in lv_bar_create()
99 ext->cur_value = 0; in lv_bar_create()
101 ext->anim_time = 200; in lv_bar_create()
102 lv_bar_init_anim(bar, &ext->cur_value_anim); in lv_bar_create()
103 lv_bar_init_anim(bar, &ext->start_value_anim); in lv_bar_create()
105 ext->type = LV_BAR_TYPE_NORMAL; in lv_bar_create()
107 lv_style_list_init(&ext->style_indic); in lv_bar_create()
118 lv_bar_set_value(bar, ext->cur_value, false); in lv_bar_create()
124 ext->min_value = ext_copy->min_value; in lv_bar_create()
125 ext->start_value = ext_copy->start_value; in lv_bar_create()
126 ext->max_value = ext_copy->max_value; in lv_bar_create()
127 ext->cur_value = ext_copy->cur_value; in lv_bar_create()
128 ext->type = ext_copy->type; in lv_bar_create()
130 lv_style_list_copy(&ext->style_indic, &ext_copy->style_indic); in lv_bar_create()
135 lv_bar_set_value(bar, ext->cur_value, LV_ANIM_OFF); in lv_bar_create()
157 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_value() local
158 if(ext->cur_value == value) return; in lv_bar_set_value()
161 new_value = value > ext->max_value ? ext->max_value : value; in lv_bar_set_value()
162 new_value = new_value < ext->min_value ? ext->min_value : new_value; in lv_bar_set_value()
164 if(ext->cur_value == new_value) return; in lv_bar_set_value()
167 ext->cur_value = new_value; in lv_bar_set_value()
170 lv_bar_set_value_with_anim(bar, new_value, &ext->cur_value, &ext->cur_value_anim, anim); in lv_bar_set_value()
184 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_start_value() local
185 if(ext->start_value == start_value) return; in lv_bar_set_start_value()
188 new_value = start_value > ext->max_value ? ext->max_value : start_value; in lv_bar_set_start_value()
189 new_value = new_value < ext->min_value ? ext->min_value : start_value; in lv_bar_set_start_value()
191 if(ext->start_value == new_value) return; in lv_bar_set_start_value()
194 ext->start_value = new_value; in lv_bar_set_start_value()
196 lv_bar_set_value_with_anim(bar, new_value, &ext->start_value, &ext->start_value_anim, anim); in lv_bar_set_start_value()
210 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_range() local
211 if(ext->min_value == min && ext->max_value == max) return; in lv_bar_set_range()
213 ext->max_value = max; in lv_bar_set_range()
214 ext->min_value = min; in lv_bar_set_range()
217 ext->start_value = min; in lv_bar_set_range()
219 if(ext->cur_value > max) { in lv_bar_set_range()
220 ext->cur_value = max; in lv_bar_set_range()
221 lv_bar_set_value(bar, ext->cur_value, false); in lv_bar_set_range()
223 if(ext->cur_value < min) { in lv_bar_set_range()
224 ext->cur_value = min; in lv_bar_set_range()
225 lv_bar_set_value(bar, ext->cur_value, false); in lv_bar_set_range()
239 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_type() local
240 ext->type = type; in lv_bar_set_type()
241 if(ext->type != LV_BAR_TYPE_CUSTOM) in lv_bar_set_type()
242 ext->start_value = ext->min_value; in lv_bar_set_type()
257 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_anim_time() local
258 ext->anim_time = anim_time; in lv_bar_set_anim_time()
278 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_value() local
279 return LV_BAR_GET_ANIM_VALUE(ext->cur_value, ext->cur_value_anim); in lv_bar_get_value()
291 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_start_value() local
293 if(ext->type != LV_BAR_TYPE_CUSTOM) return ext->min_value; in lv_bar_get_start_value()
295 return LV_BAR_GET_ANIM_VALUE(ext->start_value, ext->start_value_anim); in lv_bar_get_start_value()
307 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_min_value() local
308 return ext->min_value; in lv_bar_get_min_value()
320 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_max_value() local
321 return ext->max_value; in lv_bar_get_max_value()
333 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_type() local
334 return ext->type; in lv_bar_get_type()
347 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_anim_time() local
348 return ext->anim_time; in lv_bar_get_anim_time()
428 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in draw_indic() local
433 int32_t range = ext->max_value - ext->min_value; in draw_indic()
436 if(ext->type == LV_BAR_TYPE_SYMMETRICAL && ext->min_value < 0 && ext->max_value > 0 && in draw_indic()
437 ext->start_value == ext->min_value) sym = true; in draw_indic()
446 lv_area_copy(&ext->indic_area, &bar->coords); in draw_indic()
447 ext->indic_area.x1 += bg_left; in draw_indic()
448 ext->indic_area.x2 -= bg_right; in draw_indic()
449 ext->indic_area.y1 += bg_top; in draw_indic()
450 ext->indic_area.y2 -= bg_bottom; in draw_indic()
452 if(hor && lv_area_get_height(&ext->indic_area) < LV_BAR_SIZE_MIN) { in draw_indic()
453 ext->indic_area.y1 = bar->coords.y1 + (objh / 2) - (LV_BAR_SIZE_MIN / 2); in draw_indic()
454 ext->indic_area.y2 = ext->indic_area.y1 + LV_BAR_SIZE_MIN; in draw_indic()
456 else if(!hor && lv_area_get_width(&ext->indic_area) < LV_BAR_SIZE_MIN) { in draw_indic()
457 ext->indic_area.x1 = bar->coords.x1 + (objw / 2) - (LV_BAR_SIZE_MIN / 2); in draw_indic()
458 ext->indic_area.x2 = ext->indic_area.x1 + LV_BAR_SIZE_MIN; in draw_indic()
461 lv_coord_t indicw = lv_area_get_width(&ext->indic_area); in draw_indic()
462 lv_coord_t indich = lv_area_get_height(&ext->indic_area); in draw_indic()
473 axis1 = &ext->indic_area.x1; in draw_indic()
474 axis2 = &ext->indic_area.x2; in draw_indic()
478 axis1 = &ext->indic_area.y1; in draw_indic()
479 axis2 = &ext->indic_area.y2; in draw_indic()
484 if(LV_BAR_IS_ANIMATING(ext->start_value_anim)) { in draw_indic()
486 … (int32_t)((int32_t)anim_length * (ext->start_value_anim.anim_start - ext->min_value)) / range; in draw_indic()
488 … (int32_t)((int32_t)anim_length * (ext->start_value_anim.anim_end - ext->min_value)) / range; in draw_indic()
490 …anim_start_value_x = (((anim_start_value_end_x - anim_start_value_start_x) * ext->start_value_anim… in draw_indic()
498 …anim_start_value_x = (int32_t)((int32_t)anim_length * (ext->start_value - ext->min_value)) / range; in draw_indic()
502 if(LV_BAR_IS_ANIMATING(ext->cur_value_anim)) { in draw_indic()
504 … (int32_t)((int32_t)anim_length * (ext->cur_value_anim.anim_start - ext->min_value)) / range; in draw_indic()
506 … (int32_t)((int32_t)anim_length * (ext->cur_value_anim.anim_end - ext->min_value)) / range; in draw_indic()
509 ext->cur_value_anim.anim_state) / in draw_indic()
515 … anim_cur_value_x = (int32_t)((int32_t)anim_length * (ext->cur_value - ext->min_value)) / range; in draw_indic()
539 zero = *axis1 + (-ext->min_value * anim_length) / range; in draw_indic()
551 if(!sym && indic_length_calc(&ext->indic_area) <= 1) return; in draw_indic()
564 if((hor && lv_area_get_width(&ext->indic_area) > bg_radius * 2) || in draw_indic()
565 (!hor && lv_area_get_height(&ext->indic_area) > bg_radius * 2)) { in draw_indic()
574 lv_draw_rect(&ext->indic_area, clip_area, &draw_indic_dsc); in draw_indic()
612 lv_draw_mask_radius_init(&mask_indic_param, &ext->indic_area, draw_indic_dsc.radius, false); in draw_indic()
625 lv_draw_rect(&ext->indic_area, clip_area, &draw_indic_dsc); in draw_indic()
633 lv_draw_rect(&ext->indic_area, clip_area, &draw_indic_dsc); in draw_indic()
672 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_signal() local
673 lv_anim_del(&ext->cur_value_anim, NULL); in lv_bar_signal()
674 lv_anim_del(&ext->start_value_anim, NULL); in lv_bar_signal()
685 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_get_style() local
693 style_dsc_p = &ext->style_indic; in lv_bar_get_style()
712 lv_bar_ext_t * ext = lv_obj_get_ext_attr(var->bar); in lv_bar_anim_ready() local
714 if(var == &ext->cur_value_anim) in lv_bar_anim_ready()
715 ext->cur_value = var->anim_end; in lv_bar_anim_ready()
716 else if(var == &ext->start_value_anim) in lv_bar_anim_ready()
717 ext->start_value = var->anim_end; in lv_bar_anim_ready()
729 lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar); in lv_bar_set_value_with_anim() local
750 lv_anim_set_time(&a, ext->anim_time); in lv_bar_set_value_with_anim()