Lines Matching refs:obj

26 static lv_coord_t calc_content_width(lv_obj_t * obj);
27 static lv_coord_t calc_content_height(lv_obj_t * obj);
28 static void layout_update_core(lv_obj_t * obj);
29 static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv);
44 void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) in lv_obj_set_pos() argument
46 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_pos()
48 lv_obj_set_x(obj, x); in lv_obj_set_pos()
49 lv_obj_set_y(obj, y); in lv_obj_set_pos()
52 void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x) in lv_obj_set_x() argument
54 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_x()
59 res_x = lv_obj_get_local_style_prop(obj, LV_STYLE_X, &v_x, 0); in lv_obj_set_x()
62 lv_obj_set_style_x(obj, x, 0); in lv_obj_set_x()
66 void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y) in lv_obj_set_y() argument
68 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_y()
73 res_y = lv_obj_get_local_style_prop(obj, LV_STYLE_Y, &v_y, 0); in lv_obj_set_y()
76 lv_obj_set_style_y(obj, y, 0); in lv_obj_set_y()
80 bool lv_obj_refr_size(lv_obj_t * obj) in lv_obj_refr_size() argument
82 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_refr_size()
85 if(obj->w_layout && obj->h_layout) return false; in lv_obj_refr_size()
87 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_refr_size()
90 lv_coord_t sl_ori = lv_obj_get_scroll_left(obj); in lv_obj_refr_size()
95 if(obj->w_layout) { in lv_obj_refr_size()
96 w = lv_obj_get_width(obj); in lv_obj_refr_size()
99 w = lv_obj_get_style_width(obj, LV_PART_MAIN); in lv_obj_refr_size()
105 w = calc_content_width(obj); in lv_obj_refr_size()
111 lv_coord_t border_w = lv_obj_get_style_border_width(obj, 0); in lv_obj_refr_size()
112 w = lv_obj_get_style_pad_left(obj, 0) + border_w; in lv_obj_refr_size()
113 w += lv_obj_get_style_pad_right(obj, 0) + border_w; in lv_obj_refr_size()
120 lv_coord_t minw = lv_obj_get_style_min_width(obj, LV_PART_MAIN); in lv_obj_refr_size()
121 lv_coord_t maxw = lv_obj_get_style_max_width(obj, LV_PART_MAIN); in lv_obj_refr_size()
125 lv_coord_t st_ori = lv_obj_get_scroll_top(obj); in lv_obj_refr_size()
129 if(obj->h_layout) { in lv_obj_refr_size()
130 h = lv_obj_get_height(obj); in lv_obj_refr_size()
133 h = lv_obj_get_style_height(obj, LV_PART_MAIN); in lv_obj_refr_size()
139 h = calc_content_height(obj); in lv_obj_refr_size()
145 lv_coord_t border_w = lv_obj_get_style_border_width(obj, 0); in lv_obj_refr_size()
146 h = lv_obj_get_style_pad_top(obj, 0) + border_w; in lv_obj_refr_size()
147 h += lv_obj_get_style_pad_bottom(obj, 0) + border_w; in lv_obj_refr_size()
154 lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_MAIN); in lv_obj_refr_size()
155 lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_MAIN); in lv_obj_refr_size()
161 lv_obj_scroll_to(obj, sl_ori, st_ori, LV_ANIM_OFF); in lv_obj_refr_size()
166 if(lv_obj_get_width(obj) == w && lv_obj_get_height(obj) == h) return false; in lv_obj_refr_size()
169 lv_obj_invalidate(obj); in lv_obj_refr_size()
173 lv_obj_get_coords(obj, &ori); in lv_obj_refr_size()
186 obj->coords.y2 = obj->coords.y1 + h - 1; in lv_obj_refr_size()
187 if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) { in lv_obj_refr_size()
188 obj->coords.x1 = obj->coords.x2 - w + 1; in lv_obj_refr_size()
191 obj->coords.x2 = obj->coords.x1 + w - 1; in lv_obj_refr_size()
195 lv_event_send(obj, LV_EVENT_SIZE_CHANGED, &ori); in lv_obj_refr_size()
198 lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); in lv_obj_refr_size()
201 lv_obj_invalidate(obj); in lv_obj_refr_size()
203 obj->readjust_scroll_after_layout = 1; in lv_obj_refr_size()
207 bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); in lv_obj_refr_size()
210 lv_obj_refresh_ext_draw_size(obj); in lv_obj_refr_size()
215 void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) in lv_obj_set_size() argument
217 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_size()
219 lv_obj_set_width(obj, w); in lv_obj_set_size()
220 lv_obj_set_height(obj, h); in lv_obj_set_size()
223 void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w) in lv_obj_set_width() argument
225 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_width()
229 res_w = lv_obj_get_local_style_prop(obj, LV_STYLE_WIDTH, &v_w, 0); in lv_obj_set_width()
232 lv_obj_set_style_width(obj, w, 0); in lv_obj_set_width()
236 void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h) in lv_obj_set_height() argument
238 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_height()
242 res_h = lv_obj_get_local_style_prop(obj, LV_STYLE_HEIGHT, &v_h, 0); in lv_obj_set_height()
245 lv_obj_set_style_height(obj, h, 0); in lv_obj_set_height()
249 void lv_obj_set_content_width(lv_obj_t * obj, lv_coord_t w) in lv_obj_set_content_width() argument
251 lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); in lv_obj_set_content_width()
252 lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); in lv_obj_set_content_width()
253 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in lv_obj_set_content_width()
255 lv_obj_set_width(obj, w + pleft + pright + 2 * border_width); in lv_obj_set_content_width()
258 void lv_obj_set_content_height(lv_obj_t * obj, lv_coord_t h) in lv_obj_set_content_height() argument
260 lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); in lv_obj_set_content_height()
261 lv_coord_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); in lv_obj_set_content_height()
262 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in lv_obj_set_content_height()
264 lv_obj_set_height(obj, h + ptop + pbottom + 2 * border_width); in lv_obj_set_content_height()
267 void lv_obj_set_layout(lv_obj_t * obj, uint32_t layout) in lv_obj_set_layout() argument
269 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_layout()
271 lv_obj_set_style_layout(obj, layout, 0); in lv_obj_set_layout()
273 lv_obj_mark_layout_as_dirty(obj); in lv_obj_set_layout()
276 bool lv_obj_is_layout_positioned(const lv_obj_t * obj) in lv_obj_is_layout_positioned() argument
278 …if(lv_obj_has_flag_any(obj, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING)… in lv_obj_is_layout_positioned()
280 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_is_layout_positioned()
288 void lv_obj_mark_layout_as_dirty(lv_obj_t * obj) in lv_obj_mark_layout_as_dirty() argument
290 obj->layout_inv = 1; in lv_obj_mark_layout_as_dirty()
293 lv_obj_t * scr = lv_obj_get_screen(obj); in lv_obj_mark_layout_as_dirty()
301 void lv_obj_update_layout(const lv_obj_t * obj) in lv_obj_update_layout() argument
310 lv_obj_t * scr = lv_obj_get_screen(obj); in lv_obj_update_layout()
334 void lv_obj_set_align(lv_obj_t * obj, lv_align_t align) in lv_obj_set_align() argument
336 lv_obj_set_style_align(obj, align, 0); in lv_obj_set_align()
339 void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs) in lv_obj_align() argument
341 lv_obj_set_style_align(obj, align, 0); in lv_obj_align()
342 lv_obj_set_pos(obj, x_ofs, y_ofs); in lv_obj_align()
345 void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_… in lv_obj_align_to() argument
347 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_align_to()
349 lv_obj_update_layout(obj); in lv_obj_align_to()
350 if(base == NULL) base = lv_obj_get_parent(obj); in lv_obj_align_to()
357 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_align_to()
373 x = lv_obj_get_content_width(base) / 2 - lv_obj_get_width(obj) / 2 + bleft; in lv_obj_align_to()
374 y = lv_obj_get_content_height(base) / 2 - lv_obj_get_height(obj) / 2 + btop; in lv_obj_align_to()
381 x = lv_obj_get_content_width(base) / 2 - lv_obj_get_width(obj) / 2 + bleft; in lv_obj_align_to()
386 x = lv_obj_get_content_width(base) - lv_obj_get_width(obj) + bleft; in lv_obj_align_to()
392 y = lv_obj_get_content_height(base) - lv_obj_get_height(obj) + btop; in lv_obj_align_to()
395 x = lv_obj_get_content_width(base) / 2 - lv_obj_get_width(obj) / 2 + bleft; in lv_obj_align_to()
396 y = lv_obj_get_content_height(base) - lv_obj_get_height(obj) + btop; in lv_obj_align_to()
400 x = lv_obj_get_content_width(base) - lv_obj_get_width(obj) + bleft; in lv_obj_align_to()
401 y = lv_obj_get_content_height(base) - lv_obj_get_height(obj) + btop; in lv_obj_align_to()
406 y = lv_obj_get_content_height(base) / 2 - lv_obj_get_height(obj) / 2 + btop; in lv_obj_align_to()
410 x = lv_obj_get_content_width(base) - lv_obj_get_width(obj) + bleft; in lv_obj_align_to()
411 y = lv_obj_get_content_height(base) / 2 - lv_obj_get_height(obj) / 2 + btop; in lv_obj_align_to()
416 y = -lv_obj_get_height(obj); in lv_obj_align_to()
420 x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2; in lv_obj_align_to()
421 y = -lv_obj_get_height(obj); in lv_obj_align_to()
425 x = lv_obj_get_width(base) - lv_obj_get_width(obj); in lv_obj_align_to()
426 y = -lv_obj_get_height(obj); in lv_obj_align_to()
435 x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2; in lv_obj_align_to()
440 x = lv_obj_get_width(base) - lv_obj_get_width(obj); in lv_obj_align_to()
445 x = -lv_obj_get_width(obj); in lv_obj_align_to()
450 x = -lv_obj_get_width(obj); in lv_obj_align_to()
451 y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2; in lv_obj_align_to()
455 x = -lv_obj_get_width(obj); in lv_obj_align_to()
456 y = lv_obj_get_height(base) - lv_obj_get_height(obj); in lv_obj_align_to()
466 y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2; in lv_obj_align_to()
471 y = lv_obj_get_height(base) - lv_obj_get_height(obj); in lv_obj_align_to()
482 lv_obj_set_style_align(obj, LV_ALIGN_TOP_LEFT, 0); in lv_obj_align_to()
483 lv_obj_set_pos(obj, x, y); in lv_obj_align_to()
487 void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords) in lv_obj_get_coords() argument
489 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_coords()
491 lv_area_copy(coords, &obj->coords); in lv_obj_get_coords()
494 lv_coord_t lv_obj_get_x(const lv_obj_t * obj) in lv_obj_get_x() argument
496 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_x()
499 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_get_x()
501 rel_x = obj->coords.x1 - parent->coords.x1; in lv_obj_get_x()
507 rel_x = obj->coords.x1; in lv_obj_get_x()
512 lv_coord_t lv_obj_get_x2(const lv_obj_t * obj) in lv_obj_get_x2() argument
514 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_x2()
516 return lv_obj_get_x(obj) + lv_obj_get_width(obj); in lv_obj_get_x2()
519 lv_coord_t lv_obj_get_y(const lv_obj_t * obj) in lv_obj_get_y() argument
521 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_y()
524 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_get_y()
526 rel_y = obj->coords.y1 - parent->coords.y1; in lv_obj_get_y()
532 rel_y = obj->coords.y1; in lv_obj_get_y()
537 lv_coord_t lv_obj_get_y2(const lv_obj_t * obj) in lv_obj_get_y2() argument
539 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_y2()
541 return lv_obj_get_y(obj) + lv_obj_get_height(obj); in lv_obj_get_y2()
544 lv_coord_t lv_obj_get_x_aligned(const lv_obj_t * obj) in lv_obj_get_x_aligned() argument
546 return lv_obj_get_style_x(obj, LV_PART_MAIN); in lv_obj_get_x_aligned()
549 lv_coord_t lv_obj_get_y_aligned(const lv_obj_t * obj) in lv_obj_get_y_aligned() argument
551 return lv_obj_get_style_y(obj, LV_PART_MAIN); in lv_obj_get_y_aligned()
554 lv_coord_t lv_obj_get_width(const lv_obj_t * obj) in lv_obj_get_width() argument
556 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_width()
558 return lv_area_get_width(&obj->coords); in lv_obj_get_width()
561 lv_coord_t lv_obj_get_height(const lv_obj_t * obj) in lv_obj_get_height() argument
563 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_height()
565 return lv_area_get_height(&obj->coords); in lv_obj_get_height()
568 lv_coord_t lv_obj_get_content_width(const lv_obj_t * obj) in lv_obj_get_content_width() argument
570 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_content_width()
572 lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); in lv_obj_get_content_width()
573 lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); in lv_obj_get_content_width()
574 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in lv_obj_get_content_width()
576 return lv_obj_get_width(obj) - left - right - 2 * border_width; in lv_obj_get_content_width()
579 lv_coord_t lv_obj_get_content_height(const lv_obj_t * obj) in lv_obj_get_content_height() argument
581 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_content_height()
583 lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); in lv_obj_get_content_height()
584 lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); in lv_obj_get_content_height()
585 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in lv_obj_get_content_height()
587 return lv_obj_get_height(obj) - top - bottom - 2 * border_width; in lv_obj_get_content_height()
590 void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area) in lv_obj_get_content_coords() argument
592 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_get_content_coords()
593 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in lv_obj_get_content_coords()
595 lv_obj_get_coords(obj, area); in lv_obj_get_content_coords()
597 area->x1 += lv_obj_get_style_pad_left(obj, LV_PART_MAIN); in lv_obj_get_content_coords()
598 area->x2 -= lv_obj_get_style_pad_right(obj, LV_PART_MAIN); in lv_obj_get_content_coords()
599 area->y1 += lv_obj_get_style_pad_top(obj, LV_PART_MAIN); in lv_obj_get_content_coords()
600 area->y2 -= lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); in lv_obj_get_content_coords()
604 lv_coord_t lv_obj_get_self_width(const lv_obj_t * obj) in lv_obj_get_self_width() argument
607 lv_event_send((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); in lv_obj_get_self_width()
611 lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj) in lv_obj_get_self_height() argument
614 lv_event_send((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); in lv_obj_get_self_height()
618 bool lv_obj_refresh_self_size(lv_obj_t * obj) in lv_obj_refresh_self_size() argument
620 lv_coord_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN); in lv_obj_refresh_self_size()
621 lv_coord_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN); in lv_obj_refresh_self_size()
624 lv_obj_mark_layout_as_dirty(obj); in lv_obj_refresh_self_size()
628 void lv_obj_refr_pos(lv_obj_t * obj) in lv_obj_refr_pos() argument
630 if(lv_obj_is_layout_positioned(obj)) return; in lv_obj_refr_pos()
632 lv_obj_t * parent = lv_obj_get_parent(obj); in lv_obj_refr_pos()
633 lv_coord_t x = lv_obj_get_style_x(obj, LV_PART_MAIN); in lv_obj_refr_pos()
634 lv_coord_t y = lv_obj_get_style_y(obj, LV_PART_MAIN); in lv_obj_refr_pos()
637 lv_obj_move_to(obj, x, y); in lv_obj_refr_pos()
648 lv_coord_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN); in lv_obj_refr_pos()
649 lv_coord_t tr_y = lv_obj_get_style_translate_y(obj, LV_PART_MAIN); in lv_obj_refr_pos()
650 lv_coord_t w = lv_obj_get_width(obj); in lv_obj_refr_pos()
651 lv_coord_t h = lv_obj_get_height(obj); in lv_obj_refr_pos()
659 lv_align_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); in lv_obj_refr_pos()
667 lv_obj_move_to(obj, x, y); in lv_obj_refr_pos()
703 lv_obj_move_to(obj, x, y); in lv_obj_refr_pos()
707 void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) in lv_obj_move_to() argument
710 lv_obj_t * parent = obj->parent; in lv_obj_move_to()
716 if(lv_obj_has_flag(obj, LV_OBJ_FLAG_FLOATING)) { in lv_obj_move_to()
732 diff.x = x - obj->coords.x1; in lv_obj_move_to()
733 diff.y = y - obj->coords.y1; in lv_obj_move_to()
741 lv_obj_invalidate(obj); in lv_obj_move_to()
745 lv_obj_get_coords(obj, &ori); in lv_obj_move_to()
759 obj->coords.x1 += diff.x; in lv_obj_move_to()
760 obj->coords.y1 += diff.y; in lv_obj_move_to()
761 obj->coords.x2 += diff.x; in lv_obj_move_to()
762 obj->coords.y2 += diff.y; in lv_obj_move_to()
764 lv_obj_move_children_by(obj, diff.x, diff.y, false); in lv_obj_move_to()
767 if(parent) lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); in lv_obj_move_to()
770 lv_obj_invalidate(obj); in lv_obj_move_to()
775 bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); in lv_obj_move_to()
780 void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floa… in lv_obj_move_children_by() argument
783 uint32_t child_cnt = lv_obj_get_child_cnt(obj); in lv_obj_move_children_by()
785 lv_obj_t * child = obj->spec_attr->children[i]; in lv_obj_move_children_by()
796 void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, bool recursive, bool inv) in lv_obj_transform_point() argument
798 if(obj) { in lv_obj_transform_point()
799 lv_layer_type_t layer_type = _lv_obj_get_layer_type(obj); in lv_obj_transform_point()
802 if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv); in lv_obj_transform_point()
803 if(do_tranf) transform_point(obj, p, inv); in lv_obj_transform_point()
806 if(do_tranf) transform_point(obj, p, inv); in lv_obj_transform_point()
807 if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv); in lv_obj_transform_point()
812 void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, bool recursive, in lv_obj_get_transformed_area() argument
822 lv_obj_transform_point(obj, &p[0], recursive, inv); in lv_obj_get_transformed_area()
823 lv_obj_transform_point(obj, &p[1], recursive, inv); in lv_obj_get_transformed_area()
824 lv_obj_transform_point(obj, &p[2], recursive, inv); in lv_obj_get_transformed_area()
825 lv_obj_transform_point(obj, &p[3], recursive, inv); in lv_obj_get_transformed_area()
834 void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area) in lv_obj_invalidate_area() argument
836 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_invalidate_area()
838 lv_disp_t * disp = lv_obj_get_disp(obj); in lv_obj_invalidate_area()
843 if(!lv_obj_area_is_visible(obj, &area_tmp)) return; in lv_obj_invalidate_area()
845 _lv_inv_area(lv_obj_get_disp(obj), &area_tmp); in lv_obj_invalidate_area()
848 void lv_obj_invalidate(const lv_obj_t * obj) in lv_obj_invalidate() argument
850 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_invalidate()
854 lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); in lv_obj_invalidate()
855 lv_area_copy(&obj_coords, &obj->coords); in lv_obj_invalidate()
861 lv_obj_invalidate_area(obj, &obj_coords); in lv_obj_invalidate()
865 bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area) in lv_obj_area_is_visible() argument
867 if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return false; in lv_obj_area_is_visible()
870 lv_obj_t * obj_scr = lv_obj_get_screen(obj); in lv_obj_area_is_visible()
880 if(!lv_obj_has_flag_any(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { in lv_obj_area_is_visible()
882 lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); in lv_obj_area_is_visible()
883 lv_area_copy(&obj_coords, &obj->coords); in lv_obj_area_is_visible()
893 lv_obj_get_transformed_area(obj, area, true, false); in lv_obj_area_is_visible()
896 lv_obj_t * par = lv_obj_get_parent(obj); in lv_obj_area_is_visible()
914 bool lv_obj_is_visible(const lv_obj_t * obj) in lv_obj_is_visible() argument
916 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_is_visible()
919 lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); in lv_obj_is_visible()
920 lv_area_copy(&obj_coords, &obj->coords); in lv_obj_is_visible()
926 return lv_obj_area_is_visible(obj, &obj_coords); in lv_obj_is_visible()
930 void lv_obj_set_ext_click_area(lv_obj_t * obj, lv_coord_t size) in lv_obj_set_ext_click_area() argument
932 LV_ASSERT_OBJ(obj, MY_CLASS); in lv_obj_set_ext_click_area()
934 lv_obj_allocate_spec_attr(obj); in lv_obj_set_ext_click_area()
935 obj->spec_attr->ext_click_pad = size; in lv_obj_set_ext_click_area()
938 void lv_obj_get_click_area(const lv_obj_t * obj, lv_area_t * area) in lv_obj_get_click_area() argument
940 lv_area_copy(area, &obj->coords); in lv_obj_get_click_area()
941 if(obj->spec_attr) { in lv_obj_get_click_area()
942 area->x1 -= obj->spec_attr->ext_click_pad; in lv_obj_get_click_area()
943 area->x2 += obj->spec_attr->ext_click_pad; in lv_obj_get_click_area()
944 area->y1 -= obj->spec_attr->ext_click_pad; in lv_obj_get_click_area()
945 area->y2 += obj->spec_attr->ext_click_pad; in lv_obj_get_click_area()
949 bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point) in lv_obj_hit_test() argument
951 if(!lv_obj_has_flag(obj, LV_OBJ_FLAG_CLICKABLE)) return false; in lv_obj_hit_test()
952 if(lv_obj_has_state(obj, LV_STATE_DISABLED)) return false; in lv_obj_hit_test()
955 lv_obj_get_click_area(obj, &a); in lv_obj_hit_test()
959 if(lv_obj_has_flag(obj, LV_OBJ_FLAG_ADV_HITTEST)) { in lv_obj_hit_test()
963 lv_event_send(obj, LV_EVENT_HIT_TEST, &hit_info); in lv_obj_hit_test()
988 static lv_coord_t calc_content_width(lv_obj_t * obj) in calc_content_width() argument
990 lv_obj_scroll_to_x(obj, 0, LV_ANIM_OFF); in calc_content_width()
992 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in calc_content_width()
993 lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; in calc_content_width()
994 lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; in calc_content_width()
997 self_w = lv_obj_get_self_width(obj) + pad_left + pad_right; in calc_content_width()
1001 uint32_t child_cnt = lv_obj_get_child_cnt(obj); in calc_content_width()
1003 if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) { in calc_content_width()
1005 lv_obj_t * child = obj->spec_attr->children[i]; in calc_content_width()
1016 child_res = LV_MAX(child_res, obj->coords.x2 - child->coords.x1 + 1); in calc_content_width()
1027 child_res = LV_MAX(child_res, obj->coords.x2 - child->coords.x1 + 1); in calc_content_width()
1037 lv_obj_t * child = obj->spec_attr->children[i]; in calc_content_width()
1048 child_res = LV_MAX(child_res, child->coords.x2 - obj->coords.x1 + 1); in calc_content_width()
1059 child_res = LV_MAX(child_res, child->coords.x2 - obj->coords.x1 + 1); in calc_content_width()
1072 static lv_coord_t calc_content_height(lv_obj_t * obj) in calc_content_height() argument
1074 lv_obj_scroll_to_y(obj, 0, LV_ANIM_OFF); in calc_content_height()
1076 lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); in calc_content_height()
1077 lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; in calc_content_height()
1078 lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) + border_width; in calc_content_height()
1081 self_h = lv_obj_get_self_height(obj) + pad_top + pad_bottom; in calc_content_height()
1085 uint32_t child_cnt = lv_obj_get_child_cnt(obj); in calc_content_height()
1087 lv_obj_t * child = obj->spec_attr->children[i]; in calc_content_height()
1098 child_res = LV_MAX(child_res, child->coords.y2 - obj->coords.y1 + 1); in calc_content_height()
1110 child_res = LV_MAX(child_res, child->coords.y2 - obj->coords.y1 + 1); in calc_content_height()
1124 static void layout_update_core(lv_obj_t * obj) in layout_update_core() argument
1127 uint32_t child_cnt = lv_obj_get_child_cnt(obj); in layout_update_core()
1129 lv_obj_t * child = obj->spec_attr->children[i]; in layout_update_core()
1133 if(obj->layout_inv) { in layout_update_core()
1134 obj->layout_inv = 0; in layout_update_core()
1135 lv_obj_refr_size(obj); in layout_update_core()
1136 lv_obj_refr_pos(obj); in layout_update_core()
1139 uint32_t layout_id = lv_obj_get_style_layout(obj, LV_PART_MAIN); in layout_update_core()
1142 LV_GC_ROOT(_lv_layout_list)[layout_id - 1].cb(obj, user_data); in layout_update_core()
1147 if(obj->readjust_scroll_after_layout) { in layout_update_core()
1148 obj->readjust_scroll_after_layout = 0; in layout_update_core()
1149 lv_obj_readjust_scroll(obj, LV_ANIM_OFF); in layout_update_core()
1153 static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv) in transform_point() argument
1155 int16_t angle = lv_obj_get_style_transform_angle(obj, 0); in transform_point()
1156 int16_t zoom = lv_obj_get_style_transform_zoom(obj, 0); in transform_point()
1161 .x = lv_obj_get_style_transform_pivot_x(obj, 0), in transform_point()
1162 .y = lv_obj_get_style_transform_pivot_y(obj, 0) in transform_point()
1166 pivot.x = (LV_COORD_GET_PCT(pivot.x) * lv_area_get_width(&obj->coords)) / 100; in transform_point()
1169 pivot.y = (LV_COORD_GET_PCT(pivot.y) * lv_area_get_height(&obj->coords)) / 100; in transform_point()
1172 pivot.x = obj->coords.x1 + pivot.x; in transform_point()
1173 pivot.y = obj->coords.y1 + pivot.y; in transform_point()