Lines Matching refs:cont
35 static lv_res_t lv_cont_signal(lv_obj_t * cont, lv_signal_t sign, void * param);
36 static void lv_cont_refr_layout(lv_obj_t * cont);
37 static void lv_cont_layout_col(lv_obj_t * cont);
38 static void lv_cont_layout_row(lv_obj_t * cont);
39 static void lv_cont_layout_center(lv_obj_t * cont);
40 static void lv_cont_layout_pretty(lv_obj_t * cont);
41 static void lv_cont_layout_grid(lv_obj_t * cont);
42 static void lv_cont_refr_autofit(lv_obj_t * cont);
94 lv_cont_set_style(new_cont, LV_CONT_STYLE_MAIN, th->style.cont); in lv_cont_create()
127 void lv_cont_set_layout(lv_obj_t * cont, lv_layout_t layout) in lv_cont_set_layout() argument
129 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_set_layout()
135 cont->signal_cb(cont, LV_SIGNAL_CHILD_CHG, NULL); in lv_cont_set_layout()
147 void lv_cont_set_fit4(lv_obj_t * cont, lv_fit_t left, lv_fit_t right, lv_fit_t top, lv_fit_t bottom) in lv_cont_set_fit4() argument
149 lv_obj_invalidate(cont); in lv_cont_set_fit4()
150 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_set_fit4()
161 cont->signal_cb(cont, LV_SIGNAL_CHILD_CHG, NULL); in lv_cont_set_fit4()
173 lv_layout_t lv_cont_get_layout(const lv_obj_t * cont) in lv_cont_get_layout() argument
175 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_get_layout()
184 lv_fit_t lv_cont_get_fit_left(const lv_obj_t * cont) in lv_cont_get_fit_left() argument
186 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_get_fit_left()
195 lv_fit_t lv_cont_get_fit_right(const lv_obj_t * cont) in lv_cont_get_fit_right() argument
197 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_get_fit_right()
206 lv_fit_t lv_cont_get_fit_top(const lv_obj_t * cont) in lv_cont_get_fit_top() argument
208 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_get_fit_top()
217 lv_fit_t lv_cont_get_fit_bottom(const lv_obj_t * cont) in lv_cont_get_fit_bottom() argument
219 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_get_fit_bottom()
234 static lv_res_t lv_cont_signal(lv_obj_t * cont, lv_signal_t sign, void * param) in lv_cont_signal() argument
239 res = ancestor_signal(cont, sign, param); in lv_cont_signal()
243 lv_cont_refr_layout(cont); in lv_cont_signal()
244 lv_cont_refr_autofit(cont); in lv_cont_signal()
246 lv_cont_refr_layout(cont); in lv_cont_signal()
247 lv_cont_refr_autofit(cont); in lv_cont_signal()
249 …if(lv_obj_get_width(cont) != lv_area_get_width(param) || lv_obj_get_height(cont) != lv_area_get_he… in lv_cont_signal()
250 lv_cont_refr_layout(cont); in lv_cont_signal()
251 lv_cont_refr_autofit(cont); in lv_cont_signal()
255 lv_cont_refr_autofit(cont); in lv_cont_signal()
273 static void lv_cont_refr_layout(lv_obj_t * cont) in lv_cont_refr_layout() argument
275 lv_layout_t type = lv_cont_get_layout(cont); in lv_cont_refr_layout()
278 if(lv_obj_get_child(cont, NULL) == NULL) return; in lv_cont_refr_layout()
283 lv_cont_layout_center(cont); in lv_cont_refr_layout()
285 lv_cont_layout_col(cont); in lv_cont_refr_layout()
287 lv_cont_layout_row(cont); in lv_cont_refr_layout()
289 lv_cont_layout_pretty(cont); in lv_cont_refr_layout()
291 lv_cont_layout_grid(cont); in lv_cont_refr_layout()
299 static void lv_cont_layout_col(lv_obj_t * cont) in lv_cont_layout_col() argument
301 lv_layout_t type = lv_cont_get_layout(cont); in lv_cont_layout_col()
306 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_layout_col()
330 lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_col()
333 LV_LL_READ_BACK(cont->child_ll, child) in lv_cont_layout_col()
337 lv_obj_align(child, cont, align, hpad_corr, last_cord); in lv_cont_layout_col()
341 lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_col()
348 static void lv_cont_layout_row(lv_obj_t * cont) in lv_cont_layout_row() argument
350 lv_layout_t type = lv_cont_get_layout(cont); in lv_cont_layout_row()
355 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_layout_row()
379 lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_row()
383 LV_LL_READ_BACK(cont->child_ll, child) in lv_cont_layout_row()
387 lv_obj_align(child, cont, align, last_cord, vpad_corr); in lv_cont_layout_row()
391 lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_row()
398 static void lv_cont_layout_center(lv_obj_t * cont) in lv_cont_layout_center() argument
401 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_layout_center()
405 LV_LL_READ(cont->child_ll, child) in lv_cont_layout_center()
418 lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_center()
422 LV_LL_READ_BACK(cont->child_ll, child) in lv_cont_layout_center()
426 lv_obj_align(child, cont, LV_ALIGN_CENTER, 0, last_cord + lv_obj_get_height(child) / 2); in lv_cont_layout_center()
430 lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_center()
438 static void lv_cont_layout_pretty(lv_obj_t * cont) in lv_cont_layout_pretty() argument
443 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_layout_pretty()
444 lv_coord_t w_obj = lv_obj_get_width(cont); in lv_cont_layout_pretty()
449 child_rs = lv_ll_get_tail(&cont->child_ll); /*Set the row starter child*/ in lv_cont_layout_pretty()
452 lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_pretty()
469 child_rc = lv_ll_get_next(&cont->child_ll, child_rc); in lv_cont_layout_pretty()
479 child_rc = lv_ll_get_prev(&cont->child_ll, child_rc); /*Load the next object*/ in lv_cont_layout_pretty()
488 lv_obj_align(child_rc, cont, LV_ALIGN_IN_TOP_MID, 0, act_y); in lv_cont_layout_pretty()
494 lv_obj_align(child_rs, cont, LV_ALIGN_IN_TOP_MID, 0, act_y); in lv_cont_layout_pretty()
499 lv_obj_t * obj2 = lv_ll_get_prev(&cont->child_ll, child_rs); in lv_cont_layout_pretty()
502 …lv_obj_align(obj1, cont, LV_ALIGN_IN_TOP_LEFT, pad, act_y + (h_row - lv_obj_get_height(obj1)) / 2); in lv_cont_layout_pretty()
503 …lv_obj_align(obj2, cont, LV_ALIGN_IN_TOP_RIGHT, -pad, act_y + (h_row - lv_obj_get_height(obj2)) / … in lv_cont_layout_pretty()
513 lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT, act_x, in lv_cont_layout_pretty()
518 child_tmp = lv_ll_get_prev(&cont->child_ll, child_tmp); in lv_cont_layout_pretty()
524 child_rs = lv_ll_get_prev(&cont->child_ll, child_rc); /*Go to the next object*/ in lv_cont_layout_pretty()
527 lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_pretty()
534 static void lv_cont_layout_grid(lv_obj_t * cont) in lv_cont_layout_grid() argument
537 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_layout_grid()
538 lv_coord_t w_tot = lv_obj_get_width(cont); in lv_cont_layout_grid()
539 lv_coord_t w_obj = lv_obj_get_width(lv_obj_get_child(cont, NULL)); in lv_cont_layout_grid()
540 lv_coord_t w_fit = lv_obj_get_width_fit(cont); in lv_cont_layout_grid()
541 lv_coord_t h_obj = lv_obj_get_height(lv_obj_get_child(cont, NULL)); in lv_cont_layout_grid()
553 lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_grid()
559 LV_LL_READ_BACK(cont->child_ll, child) in lv_cont_layout_grid()
578 lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG); in lv_cont_layout_grid()
585 static void lv_cont_refr_autofit(lv_obj_t * cont) in lv_cont_refr_autofit() argument
587 lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont); in lv_cont_refr_autofit()
596 const lv_style_t * style = lv_obj_get_style(cont); in lv_cont_refr_autofit()
599 lv_obj_t * par = lv_obj_get_parent(cont); in lv_cont_refr_autofit()
609 lv_obj_get_coords(cont, &ori); in lv_cont_refr_autofit()
610 lv_obj_get_coords(cont, &tight_area); in lv_cont_refr_autofit()
612 bool has_children = lv_ll_is_empty(&cont->child_ll) ? false : true; in lv_cont_refr_autofit()
620 LV_LL_READ(cont->child_ll, child_i) in lv_cont_refr_autofit()
667 …if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area… in lv_cont_refr_autofit()
668 cont->coords.y2 != new_area.y2) { in lv_cont_refr_autofit()
670 lv_obj_invalidate(cont); in lv_cont_refr_autofit()
671 lv_area_copy(&cont->coords, &new_area); in lv_cont_refr_autofit()
672 lv_obj_invalidate(cont); in lv_cont_refr_autofit()
675 cont->signal_cb(cont, LV_SIGNAL_CORD_CHG, &ori); in lv_cont_refr_autofit()
678 par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont); in lv_cont_refr_autofit()
680 if(lv_obj_get_auto_realign(cont)) { in lv_cont_refr_autofit()
681 lv_obj_realign(cont); in lv_cont_refr_autofit()
685 LV_LL_READ(cont->child_ll, child_i) in lv_cont_refr_autofit()