Lines Matching refs:ext

103     lv_textarea_ext_t * ext = lv_obj_allocate_ext_attr(ta, sizeof(lv_textarea_ext_t));  in lv_textarea_create()  local
104 LV_ASSERT_MEM(ext); in lv_textarea_create()
105 if(ext == NULL) { in lv_textarea_create()
110 ext->pwd_mode = 0; in lv_textarea_create()
111 ext->pwd_tmp = NULL; in lv_textarea_create()
112 ext->pwd_show_time = LV_TEXTAREA_DEF_PWD_SHOW_TIME; in lv_textarea_create()
113 ext->accapted_chars = NULL; in lv_textarea_create()
114 ext->max_length = 0; in lv_textarea_create()
115 ext->cursor.state = 1; in lv_textarea_create()
116 ext->cursor.hidden = 0; in lv_textarea_create()
117 ext->cursor.blink_time = LV_TEXTAREA_DEF_CURSOR_BLINK_TIME; in lv_textarea_create()
118 ext->cursor.pos = 0; in lv_textarea_create()
119 ext->cursor.click_pos = 1; in lv_textarea_create()
120 ext->cursor.valid_x = 0; in lv_textarea_create()
121 ext->one_line = 0; in lv_textarea_create()
123 ext->text_sel_en = 0; in lv_textarea_create()
125 ext->label = NULL; in lv_textarea_create()
126 ext->placeholder_txt = NULL; in lv_textarea_create()
128 lv_style_list_init(&ext->cursor.style); in lv_textarea_create()
129 lv_style_list_init(&ext->style_placeholder); in lv_textarea_create()
132 ext->pwd_show_time = 0; in lv_textarea_create()
133 ext->cursor.blink_time = 0; in lv_textarea_create()
144 ext->label = lv_label_create(ta, NULL); in lv_textarea_create()
146 lv_obj_set_design_cb(ext->page.scrl, lv_textarea_scrollable_design); in lv_textarea_create()
148 lv_label_set_long_mode(ext->label, LV_LABEL_LONG_BREAK); in lv_textarea_create()
149 lv_label_set_text(ext->label, "Text area"); in lv_textarea_create()
150 lv_obj_set_click(ext->label, false); in lv_textarea_create()
160 lv_obj_set_design_cb(ext->page.scrl, lv_textarea_scrollable_design); in lv_textarea_create()
162 ext->label = lv_label_create(ta, copy_ext->label); in lv_textarea_create()
163 ext->pwd_mode = copy_ext->pwd_mode; in lv_textarea_create()
164 ext->accapted_chars = copy_ext->accapted_chars; in lv_textarea_create()
165 ext->max_length = copy_ext->max_length; in lv_textarea_create()
166 ext->cursor.pos = copy_ext->cursor.pos; in lv_textarea_create()
167 ext->cursor.valid_x = copy_ext->cursor.valid_x; in lv_textarea_create()
168 ext->cursor.hidden = copy_ext->cursor.hidden; in lv_textarea_create()
170 lv_style_list_copy(&ext->cursor.style, &copy_ext->cursor.style); in lv_textarea_create()
171 lv_style_list_copy(&ext->style_placeholder, &copy_ext->style_placeholder); in lv_textarea_create()
173 if(ext->pwd_mode != 0) pwd_char_hider(ta); in lv_textarea_create()
181 ext->pwd_tmp = lv_mem_alloc(len); in lv_textarea_create()
182 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_create()
183 if(ext->pwd_tmp == NULL) return NULL; in lv_textarea_create()
185 _lv_memcpy(ext->pwd_tmp, copy_ext->pwd_tmp, len); in lv_textarea_create()
195 if(ext->cursor.blink_time) { in lv_textarea_create()
205 lv_anim_set_time(&a, ext->cursor.blink_time); in lv_textarea_create()
206 lv_anim_set_playback_time(&a, ext->cursor.blink_time); in lv_textarea_create()
233 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_add_char() local
250 if(ext->one_line && (c == '\n' || c == '\r')) { in lv_textarea_add_char()
267 if(ext->pwd_mode != 0) pwd_char_hider(ta); /*Make sure all the current text contains only '*'*/ in lv_textarea_add_char()
270 if(ext->placeholder_txt) { in lv_textarea_add_char()
271 const char * txt = lv_label_get_text(ext->label); in lv_textarea_add_char()
275 lv_label_ins_text(ext->label, ext->cursor.pos, letter_buf); /*Insert the character*/ in lv_textarea_add_char()
278 if(ext->pwd_mode != 0) { in lv_textarea_add_char()
280ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(ext->pwd_tmp) + 2); /*+2: the new char + \0 */ in lv_textarea_add_char()
281 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_add_char()
282 if(ext->pwd_tmp == NULL) return; in lv_textarea_add_char()
284 _lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, (const char *)letter_buf); in lv_textarea_add_char()
288 if(ext->pwd_show_time == 0) { in lv_textarea_add_char()
300 lv_anim_set_time(&a, ext->pwd_show_time); in lv_textarea_add_char()
331 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_add_text() local
333 if(ext->pwd_mode != 0) pwd_char_hider(ta); /*Make sure all the current text contains only '*'*/ in lv_textarea_add_text()
353 if(ext->placeholder_txt) { in lv_textarea_add_text()
354 const char * txt_act = lv_label_get_text(ext->label); in lv_textarea_add_text()
359 lv_label_ins_text(ext->label, ext->cursor.pos, txt); in lv_textarea_add_text()
362 if(ext->pwd_mode != 0) { in lv_textarea_add_text()
363 ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(ext->pwd_tmp) + strlen(txt) + 1); in lv_textarea_add_text()
364 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_add_text()
365 if(ext->pwd_tmp == NULL) return; in lv_textarea_add_text()
367 _lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, txt); in lv_textarea_add_text()
371 if(ext->pwd_show_time == 0) { in lv_textarea_add_text()
383 lv_anim_set_time(&a, ext->pwd_show_time); in lv_textarea_add_text()
411 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_del_char() local
412 uint32_t cur_pos = ext->cursor.pos; in lv_textarea_del_char()
421 char * label_txt = lv_label_get_text(ext->label); in lv_textarea_del_char()
424 _lv_txt_cut(label_txt, ext->cursor.pos - 1, 1); in lv_textarea_del_char()
426 lv_label_set_text(ext->label, label_txt); in lv_textarea_del_char()
431 if(ext->placeholder_txt) { in lv_textarea_del_char()
432 const char * txt = lv_label_get_text(ext->label); in lv_textarea_del_char()
437 if(lv_obj_get_width(ext->label) == 0) { in lv_textarea_del_char()
439 lv_obj_set_width(ext->label, border_width == 0 ? 1 : border_width); in lv_textarea_del_char()
442 if(ext->pwd_mode != 0) { in lv_textarea_del_char()
443 uint32_t byte_pos = _lv_txt_encoded_get_byte_id(ext->pwd_tmp, ext->cursor.pos - 1); in lv_textarea_del_char()
444 … _lv_txt_cut(ext->pwd_tmp, ext->cursor.pos - 1, _lv_txt_encoded_size(&ext->pwd_tmp[byte_pos])); in lv_textarea_del_char()
446 ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(ext->pwd_tmp) + 1); in lv_textarea_del_char()
447 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_del_char()
448 if(ext->pwd_tmp == NULL) return; in lv_textarea_del_char()
452 lv_textarea_set_cursor_pos(ta, ext->cursor.pos - 1); in lv_textarea_del_char()
485 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_text() local
492 lv_label_set_text(ext->label, ""); in lv_textarea_set_text()
494 if(ext->pwd_mode != 0) { in lv_textarea_set_text()
495 ext->pwd_tmp[0] = '\0'; /*Clear the password too*/ in lv_textarea_set_text()
504 lv_label_set_text(ext->label, txt); in lv_textarea_set_text()
510 if(ext->placeholder_txt) { in lv_textarea_set_text()
511 const char * txt_act = lv_label_get_text(ext->label); in lv_textarea_set_text()
516 if(lv_obj_get_width(ext->label) == 0) { in lv_textarea_set_text()
518 lv_obj_set_width(ext->label, border_width == 0 ? 1 : border_width); in lv_textarea_set_text()
521 if(ext->pwd_mode != 0) { in lv_textarea_set_text()
522 ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(txt) + 1); in lv_textarea_set_text()
523 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_set_text()
524 if(ext->pwd_tmp == NULL) return; in lv_textarea_set_text()
525 strcpy(ext->pwd_tmp, txt); in lv_textarea_set_text()
529 if(ext->pwd_show_time == 0) { in lv_textarea_set_text()
541 lv_anim_set_time(&a, ext->pwd_show_time); in lv_textarea_set_text()
565 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_placeholder_text() local
570 if(ext->placeholder_txt) { in lv_textarea_set_placeholder_text()
571 lv_mem_free(ext->placeholder_txt); in lv_textarea_set_placeholder_text()
572 ext->placeholder_txt = NULL; in lv_textarea_set_placeholder_text()
578 if(ext->placeholder_txt == NULL) { in lv_textarea_set_placeholder_text()
579 ext->placeholder_txt = lv_mem_alloc(txt_len + 1); in lv_textarea_set_placeholder_text()
582 ext->placeholder_txt = lv_mem_realloc(ext->placeholder_txt, txt_len + 1); in lv_textarea_set_placeholder_text()
585 LV_ASSERT_MEM(ext->placeholder_txt); in lv_textarea_set_placeholder_text()
586 if(ext->placeholder_txt == NULL) { in lv_textarea_set_placeholder_text()
590 strcpy(ext->placeholder_txt, txt); in lv_textarea_set_placeholder_text()
607 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_cursor_pos() local
608 if((uint32_t)ext->cursor.pos == (uint32_t)pos) return; in lv_textarea_set_cursor_pos()
610 uint32_t len = _lv_txt_get_encoded_length(lv_label_get_text(ext->label)); in lv_textarea_set_cursor_pos()
616 ext->cursor.pos = pos; in lv_textarea_set_cursor_pos()
619 lv_obj_t * label_par = lv_obj_get_parent(ext->label); in lv_textarea_set_cursor_pos()
626 lv_label_get_letter_pos(ext->label, pos, &cur_pos); in lv_textarea_set_cursor_pos()
628 lv_obj_get_coords(ext->label, &label_cords); in lv_textarea_set_cursor_pos()
652 ext->cursor.valid_x = cur_pos.x; in lv_textarea_set_cursor_pos()
655 if(ext->cursor.blink_time) { in lv_textarea_set_cursor_pos()
665 lv_anim_set_time(&a, ext->cursor.blink_time); in lv_textarea_set_cursor_pos()
666 lv_anim_set_playback_time(&a, ext->cursor.blink_time); in lv_textarea_set_cursor_pos()
686 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_cursor_hidden() local
688 ext->cursor.hidden = hide ? 1 : 0; in lv_textarea_set_cursor_hidden()
702 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_cursor_click_pos() local
703 ext->cursor.click_pos = en ? 1 : 0; in lv_textarea_set_cursor_click_pos()
715 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_pwd_mode() local
716 if(ext->pwd_mode == en) return; in lv_textarea_set_pwd_mode()
719 if(ext->pwd_mode == 0 && en != false) { in lv_textarea_set_pwd_mode()
720 char * txt = lv_label_get_text(ext->label); in lv_textarea_set_pwd_mode()
722 ext->pwd_tmp = lv_mem_alloc(len + 1); in lv_textarea_set_pwd_mode()
723 LV_ASSERT_MEM(ext->pwd_tmp); in lv_textarea_set_pwd_mode()
724 if(ext->pwd_tmp == NULL) return; in lv_textarea_set_pwd_mode()
726 strcpy(ext->pwd_tmp, txt); in lv_textarea_set_pwd_mode()
733 else if(ext->pwd_mode == 1 && en == false) { in lv_textarea_set_pwd_mode()
735 lv_label_set_text(ext->label, ext->pwd_tmp); in lv_textarea_set_pwd_mode()
736 lv_mem_free(ext->pwd_tmp); in lv_textarea_set_pwd_mode()
737 ext->pwd_tmp = NULL; in lv_textarea_set_pwd_mode()
740 ext->pwd_mode = en == false ? 0 : 1; in lv_textarea_set_pwd_mode()
754 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_one_line() local
755 if(ext->one_line == en) return; in lv_textarea_set_one_line()
756 lv_label_align_t old_align = lv_label_get_align(ext->label); in lv_textarea_set_one_line()
765 ext->one_line = 1; in lv_textarea_set_one_line()
768 lv_label_set_long_mode(ext->label, LV_LABEL_LONG_EXPAND); in lv_textarea_set_one_line()
774 ext->one_line = 0; in lv_textarea_set_one_line()
776 lv_label_set_long_mode(ext->label, LV_LABEL_LONG_BREAK); in lv_textarea_set_one_line()
797 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_text_align() local
799 if(!ext->one_line) { in lv_textarea_set_text_align()
830 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_accepted_chars() local
832 ext->accapted_chars = list; in lv_textarea_set_accepted_chars()
844 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_max_length() local
846 ext->max_length = num; in lv_textarea_set_max_length()
875 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_text_sel() local
877 ext->text_sel_en = en; in lv_textarea_set_text_sel()
899 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_pwd_show_time() local
900 ext->pwd_show_time = time; in lv_textarea_set_pwd_show_time()
916 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_set_cursor_blink_time() local
917 ext->cursor.blink_time = time; in lv_textarea_set_cursor_blink_time()
920 if(ext->cursor.blink_time) { in lv_textarea_set_cursor_blink_time()
930 lv_anim_set_time(&a, ext->cursor.blink_time); in lv_textarea_set_cursor_blink_time()
931 lv_anim_set_playback_time(&a, ext->cursor.blink_time); in lv_textarea_set_cursor_blink_time()
938 ext->cursor.state = 1; in lv_textarea_set_cursor_blink_time()
941 ext->cursor.state = 1; in lv_textarea_set_cursor_blink_time()
958 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_text() local
961 if(ext->pwd_mode == 0) { in lv_textarea_get_text()
962 txt = lv_label_get_text(ext->label); in lv_textarea_get_text()
965 txt = ext->pwd_tmp; in lv_textarea_get_text()
980 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_placeholder_text() local
981 if(ext->placeholder_txt) return ext->placeholder_txt; in lv_textarea_get_placeholder_text()
994 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_label() local
995 return ext->label; in lv_textarea_get_label()
1007 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_cursor_pos() local
1008 return ext->cursor.pos; in lv_textarea_get_cursor_pos()
1020 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_cursor_hidden() local
1021 return ext->cursor.hidden ? true : false; in lv_textarea_get_cursor_hidden()
1033 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_cursor_click_pos() local
1034 return ext->cursor.click_pos ? true : false; in lv_textarea_get_cursor_click_pos()
1046 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_pwd_mode() local
1047 return ext->pwd_mode == 0 ? false : true; in lv_textarea_get_pwd_mode()
1059 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_one_line() local
1060 return ext->one_line == 0 ? false : true; in lv_textarea_get_one_line()
1072 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_accepted_chars() local
1074 return ext->accapted_chars; in lv_textarea_get_accepted_chars()
1086 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_max_length() local
1087 return ext->max_length; in lv_textarea_get_max_length()
1100 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_text_is_selected() local
1102 if((lv_label_get_text_sel_start(ext->label) == LV_DRAW_LABEL_NO_TXT_SEL || in lv_textarea_text_is_selected()
1103 lv_label_get_text_sel_end(ext->label) == LV_DRAW_LABEL_NO_TXT_SEL)) { in lv_textarea_text_is_selected()
1125 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_text_sel_en() local
1126 return ext->text_sel_en; in lv_textarea_get_text_sel_en()
1142 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_pwd_show_time() local
1144 return ext->pwd_show_time; in lv_textarea_get_pwd_show_time()
1156 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_cursor_blink_time() local
1157 return ext->cursor.blink_time; in lv_textarea_get_cursor_blink_time()
1173 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_clear_selection() local
1175 if(lv_label_get_text_sel_start(ext->label) != LV_DRAW_LABEL_NO_TXT_SEL || in lv_textarea_clear_selection()
1176 lv_label_get_text_sel_end(ext->label) != LV_DRAW_LABEL_NO_TXT_SEL) { in lv_textarea_clear_selection()
1177 lv_label_set_text_sel_start(ext->label, LV_DRAW_LABEL_NO_TXT_SEL); in lv_textarea_clear_selection()
1178 lv_label_set_text_sel_end(ext->label, LV_DRAW_LABEL_NO_TXT_SEL); in lv_textarea_clear_selection()
1221 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_cursor_down() local
1225 lv_label_get_letter_pos(ext->label, lv_textarea_get_cursor_pos(ta), &pos); in lv_textarea_cursor_down()
1233 pos.x = ext->cursor.valid_x; in lv_textarea_cursor_down()
1236 if(pos.y < lv_obj_get_height(ext->label)) { in lv_textarea_cursor_down()
1238 uint32_t new_cur_pos = lv_label_get_letter_on(ext->label, &pos); in lv_textarea_cursor_down()
1240 …lv_coord_t cur_valid_x_tmp = ext->cursor.valid_x; /*Cursor position set overwrites the valid posit… in lv_textarea_cursor_down()
1242 ext->cursor.valid_x = cur_valid_x_tmp; in lv_textarea_cursor_down()
1254 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_cursor_up() local
1258 lv_label_get_letter_pos(ext->label, lv_textarea_get_cursor_pos(ta), &pos); in lv_textarea_cursor_up()
1265 pos.x = ext->cursor.valid_x; in lv_textarea_cursor_up()
1268 uint32_t new_cur_pos = lv_label_get_letter_on(ext->label, &pos); in lv_textarea_cursor_up()
1269 …lv_coord_t cur_valid_x_tmp = ext->cursor.valid_x; /*Cursor position set overwrites the valid posit… in lv_textarea_cursor_up()
1271 ext->cursor.valid_x = cur_valid_x_tmp; in lv_textarea_cursor_up()
1330 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_scrollable_design() local
1331 const char * txt = lv_label_get_text(ext->label); in lv_textarea_scrollable_design()
1334 if(txt[0] == '\0' && ext->placeholder_txt && ext->placeholder_txt[0] != 0) { in lv_textarea_scrollable_design()
1338 switch(lv_label_get_align(ext->label)) { in lv_textarea_scrollable_design()
1349 if(ext->one_line) ph_dsc.flag |= LV_TXT_FLAG_EXPAND; in lv_textarea_scrollable_design()
1351 lv_draw_label(&scrl->coords, clip_area, &ph_dsc, ext->placeholder_txt, NULL); in lv_textarea_scrollable_design()
1356 if(ext->cursor.hidden || ext->cursor.state == 0) { in lv_textarea_scrollable_design()
1366 lv_area_copy(&cur_area, &ext->cursor.area); in lv_textarea_scrollable_design()
1368 cur_area.x1 += ext->label->coords.x1; in lv_textarea_scrollable_design()
1369 cur_area.y1 += ext->label->coords.y1; in lv_textarea_scrollable_design()
1370 cur_area.x2 += ext->label->coords.x1; in lv_textarea_scrollable_design()
1371 cur_area.y2 += ext->label->coords.y1; in lv_textarea_scrollable_design()
1376 …_lv_memcpy(letter_buf, &txt[ext->cursor.txt_byte_pos], _lv_txt_encoded_size(&txt[ext->cursor.txt_b… in lv_textarea_scrollable_design()
1419 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_signal() local
1421 if(ext->pwd_tmp != NULL) lv_mem_free(ext->pwd_tmp); in lv_textarea_signal()
1422 if(ext->placeholder_txt != NULL) lv_mem_free(ext->placeholder_txt); in lv_textarea_signal()
1424 ext->pwd_tmp = NULL; in lv_textarea_signal()
1425 ext->placeholder_txt = NULL; in lv_textarea_signal()
1434 if(ext->label) { in lv_textarea_signal()
1435 if(ext->one_line) { in lv_textarea_signal()
1442 lv_obj_set_height(ext->label, font_h); in lv_textarea_signal()
1447 lv_obj_set_width(ext->label, lv_page_get_width_fit(ta)); in lv_textarea_signal()
1448 lv_obj_set_pos(ext->label, 0, 0); /*Be sure the Label is in the correct position*/ in lv_textarea_signal()
1451 lv_label_set_text(ext->label, NULL); in lv_textarea_signal()
1457 if(ext->label) { in lv_textarea_signal()
1459 lv_obj_set_width(ext->label, lv_page_get_width_fit(ta)); in lv_textarea_signal()
1460 lv_obj_set_pos(ext->label, 0, 0); in lv_textarea_signal()
1461 lv_label_set_text(ext->label, NULL); /*Refresh the label*/ in lv_textarea_signal()
1524 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_scrollable_signal() local
1535 if(ext->label) { in lv_textarea_scrollable_signal()
1539 lv_obj_set_width(ext->label, lv_page_get_width_fit(ta)); in lv_textarea_scrollable_signal()
1540 lv_obj_set_pos(ext->label, 0, 0); in lv_textarea_scrollable_signal()
1542 lv_label_set_text(ext->label, NULL); /*Refresh the label*/ in lv_textarea_scrollable_signal()
1567 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in lv_textarea_get_style() local
1575 style_dsc_p = &ext->page.scrlbar.style; in lv_textarea_get_style()
1578 style_dsc_p = &ext->cursor.style; in lv_textarea_get_style()
1582 style_dsc_p = &ext->page.edge_flash.style; in lv_textarea_get_style()
1586 style_dsc_p = &ext->style_placeholder; in lv_textarea_get_style()
1604 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in cursor_blink_anim() local
1605 if(show != ext->cursor.state) { in cursor_blink_anim()
1606 ext->cursor.state = show == 0 ? 0 : 1; in cursor_blink_anim()
1607 if(ext->cursor.hidden == 0) { in cursor_blink_anim()
1609 lv_area_copy(&area_tmp, &ext->cursor.area); in cursor_blink_anim()
1610 area_tmp.x1 += ext->label->coords.x1; in cursor_blink_anim()
1611 area_tmp.y1 += ext->label->coords.y1; in cursor_blink_anim()
1612 area_tmp.x2 += ext->label->coords.x1; in cursor_blink_anim()
1613 area_tmp.y2 += ext->label->coords.y1; in cursor_blink_anim()
1649 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in pwd_char_hider() local
1650 if(ext->pwd_mode != 0) { in pwd_char_hider()
1651 char * txt = lv_label_get_text(ext->label); in pwd_char_hider()
1673 lv_label_set_text(ext->label, txt_tmp); in pwd_char_hider()
1686 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in char_is_accepted() local
1689 if(ext->accapted_chars == NULL && ext->max_length == 0) return true; in char_is_accepted()
1692 …if(ext->max_length > 0 && _lv_txt_get_encoded_length(lv_textarea_get_text(ta)) >= ext->max_length)… in char_is_accepted()
1697 if(ext->accapted_chars) { in char_is_accepted()
1700 while(ext->accapted_chars[i] != '\0') { in char_is_accepted()
1701 uint32_t a = _lv_txt_encoded_next(ext->accapted_chars, &i); in char_is_accepted()
1715 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in refr_cursor_area() local
1721 const char * txt = lv_label_get_text(ext->label); in refr_cursor_area()
1741 lv_label_get_letter_pos(ext->label, cur_pos, &letter_pos); in refr_cursor_area()
1744 …if(letter_pos.x + ext->label->coords.x1 + letter_w > ext->label->coords.x2 && ext->one_line == 0 && in refr_cursor_area()
1745 lv_label_get_align(ext->label) != LV_LABEL_ALIGN_RIGHT) { in refr_cursor_area()
1763 ext->cursor.txt_byte_pos = byte_pos; in refr_cursor_area()
1779 lv_area_copy(&area_tmp, &ext->cursor.area); in refr_cursor_area()
1780 area_tmp.x1 += ext->label->coords.x1; in refr_cursor_area()
1781 area_tmp.y1 += ext->label->coords.y1; in refr_cursor_area()
1782 area_tmp.x2 += ext->label->coords.x1; in refr_cursor_area()
1783 area_tmp.y2 += ext->label->coords.y1; in refr_cursor_area()
1786 lv_area_copy(&ext->cursor.area, &cur_area); in refr_cursor_area()
1788 lv_area_copy(&area_tmp, &ext->cursor.area); in refr_cursor_area()
1789 area_tmp.x1 += ext->label->coords.x1; in refr_cursor_area()
1790 area_tmp.y1 += ext->label->coords.y1; in refr_cursor_area()
1791 area_tmp.x2 += ext->label->coords.x1; in refr_cursor_area()
1792 area_tmp.y2 += ext->label->coords.y1; in refr_cursor_area()
1801 lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); in update_cursor_position_on_click() local
1802 if(ext->cursor.click_pos == 0) return; in update_cursor_position_on_click()
1803 if(ext->cursor.hidden) return; in update_cursor_position_on_click()
1811 lv_obj_get_coords(ext->label, &label_coords); in update_cursor_position_on_click()
1822 lv_coord_t label_width = lv_obj_get_width(ext->label); in update_cursor_position_on_click()
1827 lv_label_ext_t * ext_label = lv_obj_get_ext_attr(ext->label); in update_cursor_position_on_click()
1840 char_id_at_click = lv_label_get_letter_on(ext->label, &rel_pos); in update_cursor_position_on_click()
1841 click_outside_label = !lv_label_is_char_under_pos(ext->label, &rel_pos); in update_cursor_position_on_click()
1844 if(ext->text_sel_en) { in update_cursor_position_on_click()
1845 if(!ext->text_sel_in_prog && !click_outside_label && sign == LV_SIGNAL_PRESSED) { in update_cursor_position_on_click()
1847 ext->sel_start = char_id_at_click; in update_cursor_position_on_click()
1848 ext->sel_end = LV_LABEL_TEXT_SEL_OFF; in update_cursor_position_on_click()
1849 ext->text_sel_in_prog = 1; in update_cursor_position_on_click()
1852 else if(ext->text_sel_in_prog && sign == LV_SIGNAL_PRESSING) { in update_cursor_position_on_click()
1854 ext->sel_end = char_id_at_click; in update_cursor_position_on_click()
1856 … else if(ext->text_sel_in_prog && (sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_RELEASED)) { in update_cursor_position_on_click()
1862 …if(ext->text_sel_in_prog || sign == LV_SIGNAL_PRESSED) lv_textarea_set_cursor_pos(ta, char_id_at_c… in update_cursor_position_on_click()
1864 if(ext->text_sel_in_prog) { in update_cursor_position_on_click()
1868 if(ext->sel_start > ext->sel_end) { in update_cursor_position_on_click()
1869 if(ext_label->sel_start != ext->sel_end || ext_label->sel_end != ext->sel_start) { in update_cursor_position_on_click()
1870 ext_label->sel_start = ext->sel_end; in update_cursor_position_on_click()
1871 ext_label->sel_end = ext->sel_start; in update_cursor_position_on_click()
1875 else if(ext->sel_start < ext->sel_end) { in update_cursor_position_on_click()
1876 if(ext_label->sel_start != ext->sel_start || ext_label->sel_end != ext->sel_end) { in update_cursor_position_on_click()
1877 ext_label->sel_start = ext->sel_start; in update_cursor_position_on_click()
1878 ext_label->sel_end = ext->sel_end; in update_cursor_position_on_click()
1891 ext->text_sel_in_prog = 0; in update_cursor_position_on_click()
1904 char_id_at_click = lv_label_get_letter_on(ext->label, &rel_pos); in update_cursor_position_on_click()