Lines Matching refs:pinyin_ime

432     lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj;  in lv_ime_pinyin_set_keyboard()  local
434 pinyin_ime->kb = kb; in lv_ime_pinyin_set_keyboard()
435 lv_obj_add_event_cb(pinyin_ime->kb, lv_ime_pinyin_kb_event, LV_EVENT_VALUE_CHANGED, obj); in lv_ime_pinyin_set_keyboard()
436 lv_obj_align_to(pinyin_ime->cand_panel, pinyin_ime->kb, LV_ALIGN_OUT_TOP_MID, 0, 0); in lv_ime_pinyin_set_keyboard()
459 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_set_mode() local
461 LV_ASSERT_OBJ(pinyin_ime->kb, &lv_keyboard_class); in lv_ime_pinyin_set_mode()
463 pinyin_ime->mode = mode; in lv_ime_pinyin_set_mode()
466 if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { in lv_ime_pinyin_set_mode()
468 …lv_keyboard_set_map(pinyin_ime->kb, LV_KEYBOARD_MODE_USER_1, (const char *)lv_btnm_def_pinyin_k9_m… in lv_ime_pinyin_set_mode()
470 lv_keyboard_set_mode(pinyin_ime->kb, LV_KEYBOARD_MODE_USER_1); in lv_ime_pinyin_set_mode()
488 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_get_kb() local
490 return pinyin_ime->kb; in lv_ime_pinyin_get_kb()
502 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_get_cand_panel() local
504 return pinyin_ime->cand_panel; in lv_ime_pinyin_get_cand_panel()
516 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_get_dict() local
518 return pinyin_ime->dict; in lv_ime_pinyin_get_dict()
534 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_constructor() local
555 pinyin_ime->mode = LV_IME_PINYIN_MODE_K26; in lv_ime_pinyin_constructor()
556 pinyin_ime->py_page = 0; in lv_ime_pinyin_constructor()
557 pinyin_ime->ta_count = 0; in lv_ime_pinyin_constructor()
558 pinyin_ime->cand_num = 0; in lv_ime_pinyin_constructor()
559 lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); in lv_ime_pinyin_constructor()
560 lv_memset_00(pinyin_ime->py_num, sizeof(pinyin_ime->py_num)); in lv_ime_pinyin_constructor()
561 lv_memset_00(pinyin_ime->py_pos, sizeof(pinyin_ime->py_pos)); in lv_ime_pinyin_constructor()
573 pinyin_ime->cand_panel = lv_btnmatrix_create(lv_scr_act()); in lv_ime_pinyin_constructor()
574 lv_btnmatrix_set_map(pinyin_ime->cand_panel, (const char **)lv_btnm_def_pinyin_sel_map); in lv_ime_pinyin_constructor()
575 lv_obj_set_size(pinyin_ime->cand_panel, LV_PCT(100), LV_PCT(5)); in lv_ime_pinyin_constructor()
576 lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); in lv_ime_pinyin_constructor()
578 lv_btnmatrix_set_one_checked(pinyin_ime->cand_panel, true); in lv_ime_pinyin_constructor()
579 lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_CLICK_FOCUSABLE); in lv_ime_pinyin_constructor()
583 lv_obj_set_style_bg_opa(pinyin_ime->cand_panel, LV_OPA_0, 0); in lv_ime_pinyin_constructor()
584 lv_obj_set_style_border_width(pinyin_ime->cand_panel, 0, 0); in lv_ime_pinyin_constructor()
585 lv_obj_set_style_pad_all(pinyin_ime->cand_panel, 8, 0); in lv_ime_pinyin_constructor()
586 lv_obj_set_style_pad_gap(pinyin_ime->cand_panel, 0, 0); in lv_ime_pinyin_constructor()
587 lv_obj_set_style_radius(pinyin_ime->cand_panel, 0, 0); in lv_ime_pinyin_constructor()
588 lv_obj_set_style_pad_gap(pinyin_ime->cand_panel, 0, 0); in lv_ime_pinyin_constructor()
589 lv_obj_set_style_base_dir(pinyin_ime->cand_panel, LV_BASE_DIR_LTR, 0); in lv_ime_pinyin_constructor()
592 lv_obj_set_style_radius(pinyin_ime->cand_panel, 12, LV_PART_ITEMS); in lv_ime_pinyin_constructor()
593 lv_obj_set_style_bg_color(pinyin_ime->cand_panel, lv_color_white(), LV_PART_ITEMS); in lv_ime_pinyin_constructor()
594 lv_obj_set_style_bg_opa(pinyin_ime->cand_panel, LV_OPA_0, LV_PART_ITEMS); in lv_ime_pinyin_constructor()
595 lv_obj_set_style_shadow_opa(pinyin_ime->cand_panel, LV_OPA_0, LV_PART_ITEMS); in lv_ime_pinyin_constructor()
598 lv_obj_set_style_bg_opa(pinyin_ime->cand_panel, LV_OPA_COVER, LV_PART_ITEMS | LV_STATE_PRESSED); in lv_ime_pinyin_constructor()
599 …lv_obj_set_style_bg_color(pinyin_ime->cand_panel, lv_color_white(), LV_PART_ITEMS | LV_STATE_PRESS… in lv_ime_pinyin_constructor()
602 …lv_obj_add_event_cb(pinyin_ime->cand_panel, lv_ime_pinyin_cand_panel_event, LV_EVENT_VALUE_CHANGED… in lv_ime_pinyin_constructor()
606 pinyin_ime->k9_input_str_len = 0; in lv_ime_pinyin_constructor()
607 pinyin_ime->k9_py_ll_pos = 0; in lv_ime_pinyin_constructor()
608 pinyin_ime->k9_legal_py_count = 0; in lv_ime_pinyin_constructor()
609 lv_memset_00(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); in lv_ime_pinyin_constructor()
613 _lv_ll_init(&(pinyin_ime->k9_legal_py_ll), sizeof(ime_pinyin_k9_py_str_t)); in lv_ime_pinyin_constructor()
621 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_destructor() local
623 if(lv_obj_is_valid(pinyin_ime->kb)) in lv_ime_pinyin_destructor()
624 lv_obj_del(pinyin_ime->kb); in lv_ime_pinyin_destructor()
626 if(lv_obj_is_valid(pinyin_ime->cand_panel)) in lv_ime_pinyin_destructor()
627 lv_obj_del(pinyin_ime->cand_panel); in lv_ime_pinyin_destructor()
636 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_kb_event() local
650 if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { in lv_ime_pinyin_kb_event()
651 lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); in lv_ime_pinyin_kb_event()
652 uint16_t tmp_btn_str_len = strlen(pinyin_ime->input_char); in lv_ime_pinyin_kb_event()
654 tmp_btn_str_len = strlen(pinyin_ime->input_char); in lv_ime_pinyin_kb_event()
655 lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); in lv_ime_pinyin_kb_event()
656 strcat(pinyin_ime->input_char, txt); in lv_ime_pinyin_kb_event()
659 for(int index = 0; index < (pinyin_ime->ta_count + tmp_btn_str_len); index++) { in lv_ime_pinyin_kb_event()
663 pinyin_ime->ta_count = tmp_btn_str_len; in lv_ime_pinyin_kb_event()
664 pinyin_ime->k9_input_str_len = tmp_btn_str_len; in lv_ime_pinyin_kb_event()
665 lv_textarea_add_text(ta, pinyin_ime->input_char); in lv_ime_pinyin_kb_event()
674 lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); in lv_ime_pinyin_kb_event()
678 if(pinyin_ime->ta_count > 0) { in lv_ime_pinyin_kb_event()
679 if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) in lv_ime_pinyin_kb_event()
680 pinyin_ime->input_char[pinyin_ime->ta_count - 1] = '\0'; in lv_ime_pinyin_kb_event()
683 pinyin_ime->k9_input_str[pinyin_ime->ta_count - 1] = '\0'; in lv_ime_pinyin_kb_event()
686 pinyin_ime->ta_count = pinyin_ime->ta_count - 1; in lv_ime_pinyin_kb_event()
687 if(pinyin_ime->ta_count <= 0) { in lv_ime_pinyin_kb_event()
688 lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); in lv_ime_pinyin_kb_event()
695 else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) { in lv_ime_pinyin_kb_event()
699 else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { in lv_ime_pinyin_kb_event()
700 pinyin_ime->k9_input_str_len = strlen(pinyin_ime->input_char) - 1; in lv_ime_pinyin_kb_event()
701 pinyin_k9_get_legal_py(obj, pinyin_ime->k9_input_str, k9_py_map); in lv_ime_pinyin_kb_event()
709 pinyin_ime->ta_count = 0; in lv_ime_pinyin_kb_event()
710 lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); in lv_ime_pinyin_kb_event()
714 if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) { in lv_ime_pinyin_kb_event()
715 lv_ime_pinyin_set_mode(pinyin_ime, LV_IME_PINYIN_MODE_K9); in lv_ime_pinyin_kb_event()
718 lv_ime_pinyin_set_mode(pinyin_ime, LV_IME_PINYIN_MODE_K26); in lv_ime_pinyin_kb_event()
719 lv_keyboard_set_mode(pinyin_ime->kb, LV_KEYBOARD_MODE_TEXT_LOWER); in lv_ime_pinyin_kb_event()
726 …else if((pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) && ((txt[0] >= 'a' && txt[0] <= 'z') || (txt[… in lv_ime_pinyin_kb_event()
728 strcat(pinyin_ime->input_char, txt); in lv_ime_pinyin_kb_event()
730 pinyin_ime->ta_count++; in lv_ime_pinyin_kb_event()
733 else if((pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) && (txt[0] >= 'a' && txt[0] <= 'z')) { in lv_ime_pinyin_kb_event()
736 … if(strcmp(txt, "abc ") == 0) pinyin_ime->k9_input_str_len += strlen(k9_py_map[i]) + 1; in lv_ime_pinyin_kb_event()
737 … else pinyin_ime->k9_input_str_len += strlen(k9_py_map[i]); in lv_ime_pinyin_kb_event()
738 pinyin_ime->k9_input_str[pinyin_ime->ta_count] = 50 + i; in lv_ime_pinyin_kb_event()
743 pinyin_k9_get_legal_py(obj, pinyin_ime->k9_input_str, k9_py_map); in lv_ime_pinyin_kb_event()
763 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_cand_panel_event() local
777 lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); in lv_ime_pinyin_cand_panel_event()
779 for(index = 0; index < pinyin_ime->ta_count; index++) in lv_ime_pinyin_cand_panel_event()
790 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_input_proc() local
792pinyin_ime->cand_str = pinyin_search_matching(obj, pinyin_ime->input_char, &pinyin_ime->cand_num); in pinyin_input_proc()
793 if(pinyin_ime->cand_str == NULL) { in pinyin_input_proc()
797 pinyin_ime->py_page = 0; in pinyin_input_proc()
805 for(uint8_t i = 0; (i < pinyin_ime->cand_num && i < LV_IME_PINYIN_CAND_TEXT_NUM); i++) { in pinyin_input_proc()
807 lv_pinyin_cand_str[i][j] = pinyin_ime->cand_str[i * 3 + j]; in pinyin_input_proc()
811 lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); in pinyin_input_proc()
816 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_page_proc() local
817 uint16_t page_num = pinyin_ime->cand_num / LV_IME_PINYIN_CAND_TEXT_NUM; in pinyin_page_proc()
818 uint16_t sur = pinyin_ime->cand_num % LV_IME_PINYIN_CAND_TEXT_NUM; in pinyin_page_proc()
821 if(pinyin_ime->py_page) { in pinyin_page_proc()
822 pinyin_ime->py_page--; in pinyin_page_proc()
829 if(pinyin_ime->py_page < page_num) { in pinyin_page_proc()
830 pinyin_ime->py_page++; in pinyin_page_proc()
841 uint16_t offset = pinyin_ime->py_page * (3 * LV_IME_PINYIN_CAND_TEXT_NUM); in pinyin_page_proc()
842 for(uint8_t i = 0; (i < pinyin_ime->cand_num && i < LV_IME_PINYIN_CAND_TEXT_NUM); i++) { in pinyin_page_proc()
843 if((sur > 0) && (pinyin_ime->py_page == page_num)) { in pinyin_page_proc()
848 lv_pinyin_cand_str[i][j] = pinyin_ime->cand_str[offset + (i * 3) + j]; in pinyin_page_proc()
858 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in lv_ime_pinyin_style_change_event() local
862 lv_obj_set_style_text_font(pinyin_ime->cand_panel, font, 0); in lv_ime_pinyin_style_change_event()
868 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in init_pinyin_dict() local
875 pinyin_ime->dict = dict; in init_pinyin_dict()
881 pinyin_ime->py_num[letter_calc] = offset_count; in init_pinyin_dict()
891 pinyin_ime->py_num[letter_calc - 1] = offset_count; in init_pinyin_dict()
893 pinyin_ime->py_pos[letter_calc] = offset_sum; in init_pinyin_dict()
902 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_search_matching() local
916 cpHZ = &pinyin_ime->dict[pinyin_ime->py_pos[offset]]; in pinyin_search_matching()
917 count = pinyin_ime->py_num[offset]; in pinyin_search_matching()
939 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_ime_clear_data() local
942 if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { in pinyin_ime_clear_data()
943 pinyin_ime->k9_input_str_len = 0; in pinyin_ime_clear_data()
944 pinyin_ime->k9_py_ll_pos = 0; in pinyin_ime_clear_data()
945 pinyin_ime->k9_legal_py_count = 0; in pinyin_ime_clear_data()
946 lv_memset_00(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); in pinyin_ime_clear_data()
953 pinyin_ime->ta_count = 0; in pinyin_ime_clear_data()
955 lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); in pinyin_ime_clear_data()
957 lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); in pinyin_ime_clear_data()
963 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_k9_init_data() local
994 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_k9_get_legal_py() local
1011 ll_len = _lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_get_legal_py()
1012 ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_get_legal_py()
1018 ll_index = _lv_ll_ins_tail(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_get_legal_py()
1023 ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); in pinyin_k9_get_legal_py()
1044 pinyin_ime->ta_count++; in pinyin_k9_get_legal_py()
1045 pinyin_ime->k9_legal_py_count = count; in pinyin_k9_get_legal_py()
1052 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_k9_is_valid_py() local
1067 cpHZ = &pinyin_ime->dict[pinyin_ime->py_pos[offset]]; in pinyin_k9_is_valid_py()
1068 count = pinyin_ime->py_num[offset]; in pinyin_k9_is_valid_py()
1092 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_k9_fill_cand() local
1094 tmp_len = pinyin_ime->k9_legal_py_count; in pinyin_k9_fill_cand()
1103 ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_fill_cand()
1104 strcpy(pinyin_ime->input_char, ll_index->py_str); in pinyin_k9_fill_cand()
1107 (index >= pinyin_ime->k9_legal_py_count)) in pinyin_k9_fill_cand()
1111 ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ in pinyin_k9_fill_cand()
1114 pinyin_ime->k9_py_ll_pos = index; in pinyin_k9_fill_cand()
1116 lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); in pinyin_k9_fill_cand()
1117 for(index = 0; index < pinyin_ime->k9_input_str_len; index++) { in pinyin_k9_fill_cand()
1120 pinyin_ime->k9_input_str_len = strlen(pinyin_ime->input_char); in pinyin_k9_fill_cand()
1121 lv_textarea_add_text(ta, pinyin_ime->input_char); in pinyin_k9_fill_cand()
1126 lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; in pinyin_k9_cand_page_proc() local
1128 lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); in pinyin_k9_cand_page_proc()
1129 uint16_t ll_len = _lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_cand_page_proc()
1131 …if((ll_len > LV_IME_PINYIN_K9_CAND_TEXT_NUM) && (pinyin_ime->k9_legal_py_count > LV_IME_PINYIN_K9_… in pinyin_k9_cand_page_proc()
1136 ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); in pinyin_k9_cand_page_proc()
1138 if(count >= pinyin_ime->k9_py_ll_pos) break; in pinyin_k9_cand_page_proc()
1140 … ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ in pinyin_k9_cand_page_proc()
1158 … ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ in pinyin_k9_cand_page_proc()
1161 pinyin_ime->k9_py_ll_pos += count - 1; in pinyin_k9_cand_page_proc()
1167 ll_index = _lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); in pinyin_k9_cand_page_proc()
1172 … ll_index = _lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the previous list*/ in pinyin_k9_cand_page_proc()
1176 if(pinyin_ime->k9_py_ll_pos > LV_IME_PINYIN_K9_CAND_TEXT_NUM) in pinyin_k9_cand_page_proc()
1177 pinyin_ime->k9_py_ll_pos -= 1; in pinyin_k9_cand_page_proc()