EditorPen.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:513k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_composition_index
- * DESCRIPTION
- * Reset the current index and the currect page for the composition box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_composition_index(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_composition_index = 0;
- g_pen_editor_composition_page = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_CSK_content
- * DESCRIPTION
- * Set the CSK content by the input method
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_CSK_content(void)
- {
- #ifdef __MMI_WGUI_CSK_ENABLE__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* W05.36 Add Center Soft Key for switching Input Method */
- UI_string_type inputmode_string = NULL;
- PU8 inputbox_information_icon = NULL;
- U16 name[] = {0x0};
- #if defined(__MMI_LANG_MARATHI__)
- U16 input_mode_marathi_string_array[] = {C_MA, C_RA, DV_AA, C_TTHA, DV_II, 0x0};
- #endif /* defined(__MMI_LANG_MARATHI__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
- set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
- switch (MMI_current_input_mode)
- {
- case INPUT_MODE_SMART_UPPERCASE_ABC:
- inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_ABC_STRING_ID);
- break;
- case INPUT_MODE_SMART_LOWERCASE_ABC:
- inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
- case INPUT_MODE_MMI_LOWERCASE_ABC:
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_abc_STRING_ID);
- break;
- #ifdef __MMI_LANG_THAI__ //KP Jerry add on 2007-4-29
- case INPUT_MODE_MULTITAP_THAI:
- case INPUT_MODE_MMI_MULTITAP_THAI:
- case INPUT_MODE_SMART_THAI:
- inputmode_string=(UI_string_type)get_string(WGUI_CATEGORY_thai_STRING_ID); //KP Jerry enable on 2007-4-29
- break;
- #endif //KP Jerry add on 2007-4-29
- case INPUT_MODE_MULTITAP_UPPERCASE_SPANISH:
- case INPUT_MODE_SMART_UPPERCASE_SPANISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_SPANISH_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_SPANISH:
- case INPUT_MODE_MMI_LOWERCASE_SPANISH:
- case INPUT_MODE_SMART_LOWERCASE_SPANISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_spanish_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_DANISH:
- case INPUT_MODE_SMART_UPPERCASE_DANISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_DANISH_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_DANISH:
- case INPUT_MODE_MMI_LOWERCASE_DANISH:
- case INPUT_MODE_SMART_LOWERCASE_DANISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_danish_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_FRENCH:
- case INPUT_MODE_SMART_UPPERCASE_FRENCH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_FRENCH_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_FRENCH:
- case INPUT_MODE_MMI_LOWERCASE_FRENCH:
- case INPUT_MODE_SMART_LOWERCASE_FRENCH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_french_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_GERMAN:
- case INPUT_MODE_SMART_UPPERCASE_GERMAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_GERMAN_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_GERMAN:
- case INPUT_MODE_MMI_LOWERCASE_GERMAN:
- case INPUT_MODE_SMART_LOWERCASE_GERMAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_german_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN:
- case INPUT_MODE_SMART_UPPERCASE_ITALIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_ITALIAN_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN:
- case INPUT_MODE_MMI_LOWERCASE_ITALIAN:
- case INPUT_MODE_SMART_LOWERCASE_ITALIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_italian_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
- case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_RUSSIAN_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
- case INPUT_MODE_MMI_LOWERCASE_RUSSIAN:
- case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_russian_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_TURKISH:
- case INPUT_MODE_SMART_UPPERCASE_TURKISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_TURKISH_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_TURKISH:
- case INPUT_MODE_MMI_LOWERCASE_TURKISH:
- case INPUT_MODE_SMART_LOWERCASE_TURKISH:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_turkish_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE:
- case INPUT_MODE_SMART_UPPERCASE_PORTUGUESE:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_PORTUGUESE_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE:
- case INPUT_MODE_MMI_LOWERCASE_PORTUGUESE:
- case INPUT_MODE_SMART_LOWERCASE_PORTUGUESE:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_portuguese_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_HINDI:
- inputmode_string = (UI_string_type) name;
- break;
- #if defined(__MMI_LANG_MARATHI__)
- case INPUT_MODE_MULTITAP_MARATHI:
- inputmode_string = (UI_string_type) input_mode_marathi_string_array;
- break;
- #endif /* defined(__MMI_LANG_MARATHI__) */
- case INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN:
- case INPUT_MODE_SMART_UPPERCASE_INDONESIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_INDONESIAN_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN:
- case INPUT_MODE_MMI_LOWERCASE_INDONESIAN:
- case INPUT_MODE_SMART_LOWERCASE_INDONESIAN:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_indonesian_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_MALAY:
- case INPUT_MODE_SMART_UPPERCASE_MALAY:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_MALAY_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_MALAY:
- case INPUT_MODE_MMI_LOWERCASE_MALAY:
- case INPUT_MODE_SMART_LOWERCASE_MALAY:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_malay_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_VIETNAMESE_STRING_ID);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
- case INPUT_MODE_MMI_LOWERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_vietnamese_STRING_ID);
- break;
- case INPUT_MODE_123:
- case INPUT_MODE_MMI_NUMERIC:
- case INPUT_MODE_123_SYMBOLS:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_123_STRING_ID);
- break;
- case INPUT_MODE_SMART_ARABIC:
- /* inputmode_string=(UI_string_type)get_string(STR_INPUT_METHOD_ARABIC); */
- break;
- case INPUT_MODE_MMI_MULTITAP_BPMF:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_BPMF_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_MMI_MULTITAP_PINYIN:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_PINYIN_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_PINYIN_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_MMI_SM_STROKE:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_SM_STROKE_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_SM_STROKE_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_MMI_TR_STROKE:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_TR_STROKE_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_TR_STROKE_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_TR_MULTITAP_BOPOMO:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_BPMF_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_SM_MULTITAP_PINYIN:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_PINYIN_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_PINYIN_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_TR_STROKE:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_TR_STROKE_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_TR_STROKE_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_SM_STROKE:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_SM_STROKE_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_SM_STROKE_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_TR_BOPOMO:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_SMART_BPMF_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_BPMF_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_SMART_BPMF_IMG);
- #endif
- break;
- case INPUT_MODE_SM_PINYIN:
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- inputbox_information_icon = get_image(WGUI_IME_SMART_PINYIN_IMG);
- #elif defined(__MMI_ZI__)
- inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_PINYIN_LOGO);
- #else
- inputbox_information_icon = get_image(WGUI_IME_SMART_PINYIN_IMG);
- #endif
- break;
- }
- if (NULL != inputmode_string)
- {
- set_softkey_label(inputmode_string, MMI_CENTER_SOFTKEY);
- }
- if (NULL != inputbox_information_icon)
- {
- set_softkey_icon(inputbox_information_icon, MMI_CENTER_SOFTKEY);
- }
- redraw_softkey(MMI_CENTER_SOFTKEY);
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_exit_screen
- * DESCRIPTION
- * Common function for handwriting when exiting screen. This is used in UI_common_screen_exit.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_exit_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.04 Set gPenEditorGDIHandler to NULL when exiting screen */
- gPenEditorGDIHandler = NULL;
- gPenEditorListMenuHeight = 0;
- if (gPenEditorStrokeGDIBuffer)
- {
- mmi_frm_scrmem_free((void*)gPenEditorStrokeGDIBuffer);
- }
- gPenEditorStrokeGDIBuffer = NULL;
- }
- /* W06.09 Touch Screen With Keypad V1 */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_key_down_handler
- * DESCRIPTION
- * The handler of key down(number keys) in Multitap BPMF/PinYin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_key_down_handler(S32 key)
- {
- //Jerry add on 2007-1-12 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if(gPenEditorFirstStroke)
- {
- #endif
- //Jerry add on 2007-1-12 end
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_editor_cancel_handwriting();
- if (gPenEditorSelectCandidate && (0 == gPenEditorVKText.TextLength))
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- if (key < 0 || key > MAX_MULTITAPS - 1)
- {
- return;
- }
- if (MMI_virtual_keyboard.lang_type == GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL)
- {
- mmi_pen_editor_vk_symbol_picker();
- }
- if (MMI_virtual_keyboard.lang_type == GUI_VIRTUAL_KEYBOARD_TRAY)
- {
- mmi_pen_editor_vk_show();
- }
- if (key != g_pen_editor_active_multitap_index)
- {
- if (g_pen_editor_active_multitap_index >= 0)
- {
- gui_multitap_input_complete(&
- (g_pen_editor_bpmf_pinyin_active_multitap[g_pen_editor_active_multitap_index]));
- }
- g_pen_editor_active_multitap_index = key;
- }
- gui_change_multitap_input_state(&(g_pen_editor_bpmf_pinyin_active_multitap[g_pen_editor_active_multitap_index]));
- //Jerry add on 2007-1-12 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- }
- #endif
- //Jerry add on 2007-1-12 end
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_key_up_handler
- * DESCRIPTION
- * The handler of key up(number keys) in Multitap BPMF/PinYin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_key_up_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key);
- gui_start_timer(MMI_MULTITAP_TIMEOUT, mmi_pen_editor_bpmf_pinyin_disable_active_multitap);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_disable_active_multitap
- * DESCRIPTION
- * Complete Multitap input for Multitap BPMF/PinYin
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_disable_active_multitap(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_active_multitap_index < 0)
- {
- return;
- }
- gui_multitap_input_complete(&g_pen_editor_bpmf_pinyin_active_multitap[g_pen_editor_active_multitap_index]);
- g_pen_editor_active_multitap_index = -1;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_multitap_input
- * DESCRIPTION
- * Handle the multitap input character c in multitap BPMF/PinYin
- * PARAMETERS
- * c [IN] The multitap input character
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_multitap_input(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_bpmf_pinyin_previous_valid_character)
- {
- mmi_pen_editor_vk_delete_character(&gPenEditorVKText);
- }
- if (mmi_pen_editor_vk_insert_character(&gPenEditorVKText, c))
- {
- /* Check the input is valid or not */
- if (mmi_pen_editor_get_candidates_by_vk())
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_inputbox_RSK_label_clear = 1;
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- category28_RSK_label_clear = 1;
- break;
- default:
- break;
- }
- /* Temp Solution for LSK Text Update */
- /* W05.35 For LSK Text Issue */
- if (gPenEditorVKText.TextLength == 1 && MMI_FALSE == gPenEditorSelectCandidate)
- {
- mmi_pen_editor_store_LSK_Text();
- }
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- gPenEditorSelectCandidate = MMI_TRUE;
- mmi_pen_editor_register_arrow_keys();
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_CLEAR);
- g_pen_editor_bpmf_pinyin_previous_valid_character = c;
- }
- else
- {
- mmi_pen_editor_vk_delete_character(&gPenEditorVKText);
- if (g_pen_editor_bpmf_pinyin_previous_valid_character)
- {
- mmi_pen_editor_vk_insert_character(
- &gPenEditorVKText,
- g_pen_editor_bpmf_pinyin_previous_valid_character);
- }
- }
- }
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_multitap_input_complete
- * DESCRIPTION
- * Set g_pen_editor_bpmf_pinyin_previous_valid_character to 0 when conmpleting multitap input
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_multitap_input_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_bpmf_pinyin_previous_valid_character = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_register_multitap_function
- * DESCRIPTION
- * Register key functions for Multitap BPMF/PinYin and set Multitap BPMF/Pinyin functions to g_pen_editor_bpmf_pinyin_active_multitap
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_register_multitap_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_MMI_key_input_handler();
- register_key_up_handler(mmi_pen_editor_bpmf_pinyin_key_up_handler);
- register_key_down_handler(mmi_pen_editor_bpmf_pinyin_key_down_handler);
- for (i = 0; i < MAX_MULTITAPS; i++)
- {
- gui_set_multitap_input_callbacks(
- &g_pen_editor_bpmf_pinyin_active_multitap[i],
- mmi_pen_editor_bpmf_pinyin_multitap_input,
- mmi_pen_editor_bpmf_pinyin_multitap_input_complete);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bpmf_pinyin_create_multitap
- * DESCRIPTION
- * Create multitap control according to input_mode
- * PARAMETERS
- * input_mode [IN] Its value should be INPUT_MODE_TR_MULTITAP_BOPOMO or INPUT_MODE_SM_MULTITAP_PINYIN
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bpmf_pinyin_create_multitap(U8 input_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, width;
- UI_string_type s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- width = MMI_multitap_width; /* Width needs to be auto-calculated */
- g_pen_editor_active_multitap_index = -1;
- for (i = 0; i < MAX_MULTITAPS; i++)
- {
- if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode)
- {
- s = get_bpmf_multitap_string(i);
- gui_create_multitap_input(
- &g_pen_editor_bpmf_pinyin_active_multitap[i],
- MMI_multitap_x,
- MMI_multitap_y,
- width,
- MMI_multitap_height,
- s);
- }
- else if (INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode)
- {
- s = (UI_string_type) numberless_lowercase_multitap_strings[i];
- gui_create_multitap_input(
- &g_pen_editor_bpmf_pinyin_active_multitap[i],
- MMI_multitap_x,
- MMI_multitap_y,
- width,
- MMI_multitap_height,
- s);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hold_confirm
- * DESCRIPTION
- * Do not confirm the selection directly when the candidate box is on
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_hold_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- g_pen_editor_hold_confirm = MMI_TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_register_key_function
- * DESCRIPTION
- * Register key functions for Smart Latin
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_register_key_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_MMI_key_input_handler();
- register_key_up_handler(mmi_pen_editor_smart_latin_key_up_handler);
- register_key_down_handler(mmi_pen_editor_smart_latin_key_down_handler);
- ClearKeyHandler(KEY_0, KEY_REPEAT);
- ClearKeyHandler(KEY_1, KEY_REPEAT);
- ClearKeyHandler(KEY_2, KEY_REPEAT);
- ClearKeyHandler(KEY_3, KEY_REPEAT);
- ClearKeyHandler(KEY_4, KEY_REPEAT);
- ClearKeyHandler(KEY_5, KEY_REPEAT);
- ClearKeyHandler(KEY_6, KEY_REPEAT);
- ClearKeyHandler(KEY_7, KEY_REPEAT);
- ClearKeyHandler(KEY_8, KEY_REPEAT);
- ClearKeyHandler(KEY_9, KEY_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_key_down_handler
- * DESCRIPTION
- * The handler of key down(number keys) in Smart Latin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_key_down_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_KEY_BUFFER_SIZE];
- U32 candidatelength = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!mmi_pen_editor_get_remaining_length())
- {
- return;
- }
- gdi_layer_lock_frame_buffer();
- if (gPenEditorSelectCandidate && !g_pen_editor_key_sequence.KeyLength)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- if (KEY_0 == key)
- {
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- mmi_pen_editor_smart_latin_confirm_select();
- mmi_pen_editor_set_left_soft_key();
- }
- mmi_pen_editor_input_character(0x20, MMI_FALSE);
- }
- else if (mmi_pen_editor_add_key_sequence(&g_pen_editor_key_sequence, key))
- {
- candidatelength = mmi_ime_smart_latin_get_candidates_by_key_sequence(
- g_pen_editor_key_sequence.KeySequence,
- g_pen_editor_key_sequence.KeyLength,
- candidate_buffer);
- if (candidatelength)
- {
- if (candidatelength < g_pen_editor_key_sequence.KeyLength)
- {
- mmi_pen_editor_smart_latin_confirm_select();
- mmi_pen_editor_add_key_sequence(&g_pen_editor_key_sequence, key);
- candidatelength = mmi_ime_smart_latin_get_candidates_by_key_sequence(
- g_pen_editor_key_sequence.KeySequence,
- g_pen_editor_key_sequence.KeyLength,
- candidate_buffer);
- }
- mmi_pen_editor_smart_latin_replace_candidate(candidate_buffer, candidatelength);
- if (g_pen_editor_key_sequence.KeyLength == 1 && MMI_FALSE == gPenEditorSelectCandidate)
- {
- mmi_pen_editor_store_LSK_Text();
- }
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- mmi_pen_editor_smart_latin_register_arrow_keys();
- }
- else
- {
- mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence);
- }
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_key_up_handler
- * DESCRIPTION
- * The handler of key up(number keys) in Smart Latin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_key_up_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_highlight_candidate
- * DESCRIPTION
- * Unhighlight the candidate in Smart Latin
- * PARAMETERS
- * candidate_length [IN] The length of the highlighted candidate
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_highlight_candidate(U32 candidate_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 count = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- count = gui_multi_line_input_box_highlight_cursor_number(&MMI_multiline_inputbox, candidate_length);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- count = gui_EMS_input_box_highlight_cursor_number(&MMI_EMS_inputbox, candidate_length);
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- count = gui_single_line_input_box_highlight_cursor_number(&MMI_singleline_inputbox, candidate_length);
- break;
- case PEN_EDITOR_INLINE_TEXT:
- count = gui_single_line_input_box_highlight_cursor_number(&MMI_inline_singleline_inputbox, candidate_length);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_unhighlight_candidate
- * DESCRIPTION
- *
- * PARAMETERS
- * draw [IN] MMI_TRUE : Redraw the input box
- * MMI_FALSE : Do not redraw the input box
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_unhighlight_candidate(MMI_BOOL draw)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- if (draw)
- {
- gui_show_multi_line_input_box(&MMI_multiline_inputbox);
- }
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_WORD_HIGHLIGHT;
- if (draw)
- {
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- }
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- MMI_singleline_inputbox.flags &= ~UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- if (draw)
- {
- gui_show_single_line_input_box(&MMI_singleline_inputbox);
- }
- break;
- case PEN_EDITOR_INLINE_TEXT:
- MMI_inline_singleline_inputbox.flags &= ~UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- if (draw)
- {
- gui_show_single_line_input_box(&MMI_inline_singleline_inputbox);
- }
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_chinese_stroke_register_key_function
- * DESCRIPTION
- * Register key functions for Chinese Stroke
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_chinese_stroke_register_key_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_MMI_key_input_handler();
- register_key_up_handler(mmi_pen_editor_chinese_stroke_key_up_handler);
- register_key_down_handler(mmi_pen_editor_chinese_stroke_key_down_handler);
- ClearKeyHandler(KEY_0, KEY_REPEAT);
- ClearKeyHandler(KEY_1, KEY_REPEAT);
- ClearKeyHandler(KEY_2, KEY_REPEAT);
- ClearKeyHandler(KEY_3, KEY_REPEAT);
- ClearKeyHandler(KEY_4, KEY_REPEAT);
- ClearKeyHandler(KEY_5, KEY_REPEAT);
- ClearKeyHandler(KEY_6, KEY_REPEAT);
- ClearKeyHandler(KEY_7, KEY_REPEAT);
- ClearKeyHandler(KEY_8, KEY_REPEAT);
- ClearKeyHandler(KEY_9, KEY_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_chinese_stroke_key_down_handler
- * DESCRIPTION
- * The handler of key down(number keys) in Chinese Stroke
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_chinese_stroke_key_down_handler(S32 key)
- {
- //Jerry add on 2007-1-12 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if(gPenEditorFirstStroke)
- {
- #endif
- //Jerry add on 2007-1-12 end
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_cancel_handwriting();
- if (gPenEditorSelectCandidate && (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_OFF))
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- if (KEY_0 == key)
- {
- }
- else
- #if defined(__MMI_T9__) || defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-21
- if (KEY_7 <= key && KEY_9 >= key)
- {
- }
- else
- #endif
- if (mmi_pen_editor_add_key_sequence(&g_pen_editor_key_sequence, key))
- {
- if (mmi_pen_editor_chinese_stroke_get_candidates_by_key_sequence(&g_pen_editor_key_sequence))
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_inputbox_RSK_label_clear = 1;
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- category28_RSK_label_clear = 1;
- break;
- default:
- break;
- }
- /* Temp Solution for LSK Text Update */
- /* W05.35 For LSK Text Issue */
- if (g_pen_editor_key_sequence.KeyLength == 1 && MMI_FALSE == gPenEditorSelectCandidate)
- {
- mmi_pen_editor_store_LSK_Text();
- }
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- gPenEditorSelectCandidate = MMI_TRUE;
- mmi_pen_editor_register_arrow_keys();
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_CLEAR);
- }
- else
- {
- mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence);
- }
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- mmi_pen_editor_change_handwriting_area();
- //Jerry add on 2007-1-12 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- }
- #endif
- //Jerry add on 2007-1-12 end
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_chinese_stroke_key_up_handler
- * DESCRIPTION
- * The handler of key up(number keys) in Chinese Stroke
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_chinese_stroke_key_up_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_remaining_length
- * DESCRIPTION
- * To know how many characters could be inserted in current state
- * PARAMETERS
- * void
- * RETURNS
- * The number of the characters could be inserted
- *****************************************************************************/
- S32 mmi_pen_editor_get_remaining_length(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- return (gui_multi_line_input_box_get_remaining_length(&MMI_multiline_inputbox));
- case PEN_EDITOR_EMS_INPUT_BOX:
- return (EMS_get_remaining_length(MMI_EMS_inputbox.data));
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- return (gui_single_line_input_box_get_remaining_length(&MMI_singleline_inputbox));
- case PEN_EDITOR_INLINE_TEXT:
- return (gui_single_line_input_box_get_remaining_length(&MMI_inline_singleline_inputbox));
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- return 0;
- default:
- MMI_ASSERT(0);
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_confirm_select
- * DESCRIPTION
- * Confirm the selection in Smart Latin
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_confirm_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_smart_latin_pre_candidate_length = 0;
- g_pen_editor_smart_latin_candidate_index = 0;
- mmi_pen_editor_smart_latin_unhighlight_candidate(MMI_TRUE);
- mmi_pen_editor_reset_key_sequence(&g_pen_editor_key_sequence);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_replace_candidate
- * DESCRIPTION
- * Replace the candiate in the input box the candidate is changed
- * PARAMETERS
- * candidate_buffer [OUT] The new candidate
- * candidatelength [IN] The length of the candidate
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_replace_candidate(UI_character_type *candidate_buffer, S32 candidatelength)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- for (i = 0; i < g_pen_editor_smart_latin_pre_candidate_length; i++)
- {
- mmi_pen_editor_backspace();
- }
- }
- g_pen_editor_smart_latin_pre_candidate_length = candidatelength;
- for (i = 0; i < g_pen_editor_smart_latin_pre_candidate_length; i++)
- {
- mmi_pen_editor_input_character(candidate_buffer[i], MMI_FALSE);
- }
- mmi_pen_editor_smart_latin_highlight_candidate(g_pen_editor_smart_latin_pre_candidate_length);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_CLEAR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_register_key_function
- * DESCRIPTION
- * Register key functions for Smart BPMF/PinYin
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_register_key_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_MMI_key_input_handler();
- register_key_up_handler(mmi_pen_editor_smart_bpmf_pinyin_key_up_handler);
- register_key_down_handler(mmi_pen_editor_smart_bpmf_pinyin_key_down_handler);
- ClearKeyHandler(KEY_0, KEY_REPEAT);
- ClearKeyHandler(KEY_1, KEY_REPEAT);
- ClearKeyHandler(KEY_2, KEY_REPEAT);
- ClearKeyHandler(KEY_3, KEY_REPEAT);
- ClearKeyHandler(KEY_4, KEY_REPEAT);
- ClearKeyHandler(KEY_5, KEY_REPEAT);
- ClearKeyHandler(KEY_6, KEY_REPEAT);
- ClearKeyHandler(KEY_7, KEY_REPEAT);
- ClearKeyHandler(KEY_8, KEY_REPEAT);
- ClearKeyHandler(KEY_9, KEY_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_key_down_handler
- * DESCRIPTION
- * The handler of key down(number keys) in Smart BPMF/PinYin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_key_down_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_cancel_handwriting();
- if (gPenEditorSelectCandidate && (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_OFF))
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- if (KEY_0 == key &&
- (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_OFF) &&
- INPUT_MODE_SM_PINYIN == MMI_current_input_mode && !gPenEditorSelectCandidate)
- {
- mmi_pen_editor_input_character(0x20, MMI_FALSE);
- }
- else if (KEY_1 == key && INPUT_MODE_SM_PINYIN == MMI_current_input_mode)
- {
- }
- else if (mmi_pen_editor_add_key_sequence(&g_pen_editor_key_sequence, key))
- {
- if (mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_TRUE))
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_inputbox_RSK_label_clear = 1;
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- category28_RSK_label_clear = 1;
- break;
- default:
- break;
- }
- /* Temp Solution for LSK Text Update */
- /* W05.35 For LSK Text Issue */
- if (g_pen_editor_key_sequence.KeyLength == 1 && MMI_FALSE == gPenEditorSelectCandidate)
- {
- mmi_pen_editor_store_LSK_Text();
- }
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- gPenEditorSelectCandidate = MMI_TRUE;
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- mmi_pen_editor_smart_bpmf_pinyin_register_arrow_keys();
- break;
- default:
- break;
- }
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_CLEAR);
- }
- else
- {
- mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence);
- }
- mmi_pen_editor_show_composition_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_key_up_handler
- * DESCRIPTION
- * The handler of key up(number keys) in Smart BPMF/PinYin
- * PARAMETERS
- * key [IN] The key index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_key_up_handler(S32 key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_chinese_stroke_get_candidates_by_key_sequence
- * DESCRIPTION
- * Get the candidates from the key sequence for Chinese Stroke
- * PARAMETERS
- * key_sequence [IN] The key sequence of Chinese Stroke
- * RETURNS
- * The number of the candidates
- *****************************************************************************/
- S32 mmi_pen_editor_chinese_stroke_get_candidates_by_key_sequence(mmi_pen_editor_key_sequence_struct *key_sequence)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- UI_character_type stroke_buffer[PEN_EDITOR_MAX_KEY_BUFFER_SIZE];
- U32 num = 0, i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- num = mmi_ime_chinese_stroke_get_candidates_by_key_sequence(
- key_sequence->KeySequence,
- key_sequence->KeyLength,
- candidate_buffer,
- stroke_buffer);
- if (num)
- {
- mmi_pen_editor_reset_candidate_index();
- if ((g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_OFF))
- {
- int change_height = 0;
- if (PEN_EDITOR_VK_ON == gPenEditorVKState && (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type))
- {
- mmi_pen_editor_vk_hide();
- }
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- change_height -= g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS;
- }
- gui_single_line_input_box_delete_all(&g_pen_editor_composition_input_box);
- for (i = 0; i < g_pen_editor_key_sequence.KeyLength; i++)
- {
- gui_single_line_input_box_insert_character(&g_pen_editor_composition_input_box, stroke_buffer[i]);
- }
- mmi_pen_editor_show_composition_area(MMI_FALSE, PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS);
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (i = 0; i < num; i++)
- {
- gui_single_line_input_box_insert_character(&gPenEditorCandidateInputBox, candidate_buffer[i]);
- }
- gui_single_line_input_box_goto_first_character(&gPenEditorCandidateInputBox);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- }
- return num;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence
- * DESCRIPTION
- * Get the candidates from the key sequence for Smart BPMF/PinYin
- * PARAMETERS
- * key_sequence [IN] The key sequence of Smart BPMF/PinYin
- * is_reset [IN] MMI_TRUE : Resest the index for the composition box
- * MMI_FALSE : Do not resest the index for the composition box
- * RETURNS
- * The number of the candidates
- *****************************************************************************/
- S32 mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(
- mmi_pen_editor_key_sequence_struct *key_sequence,
- BOOL is_reset)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type syllable_buffer[PEN_EDITOR_MAX_SYLLABLE_BUFFER_SIZE];
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- U32 num = 0, i = 0, j = 0, k = 0;
- S32 start_index,end_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (is_reset)
- {
- start_index = 0;
- end_index = PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
- }
- else
- {
- start_index = g_pen_editor_composition_page * PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE;
- end_index = (g_pen_editor_composition_page + 1) * PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
- }
- num = mmi_ime_smart_bpmf_pinyin_get_syllable_by_key_sequence(
- key_sequence->KeySequence,
- key_sequence->KeyLength,
- syllable_buffer,
- start_index,
- end_index);
- if (num)
- {
- mmi_pen_editor_reset_candidate_index();
- if (is_reset)
- {
- mmi_pen_editor_reset_composition_index();
- }
- if ((g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_OFF))
- {
- int change_height = 0;
- if (PEN_EDITOR_VK_ON == gPenEditorVKState && (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type))
- {
- mmi_pen_editor_vk_hide();
- }
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- change_height -= g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_ON_AND_FOCUS;
- }
- memset(g_pen_editor_syllable_table, 0, sizeof(g_pen_editor_syllable_table));
- gui_single_line_input_box_delete_all(&g_pen_editor_composition_input_box);
- for (i = 0;; i++)
- {
- if (syllable_buffer[i])
- {
- gui_single_line_input_box_insert_character(&g_pen_editor_composition_input_box, syllable_buffer[i]);
- if (syllable_buffer[i] == 0x20)
- {
- g_pen_editor_syllable_table[j][k] = ' ';
- j++;
- k = 0;
- }
- else
- {
- g_pen_editor_syllable_table[j][k++] = syllable_buffer[i];
- }
- }
- else
- {
- gui_single_line_input_box_insert_character(&g_pen_editor_composition_input_box, 0x20);
- g_pen_editor_syllable_table[j+1][0] = syllable_buffer[i];
- break;
- }
- }
- gui_single_line_input_box_goto_first_character(&g_pen_editor_composition_input_box);
- for (i = 0;;)
- {
- UI_character_type ch, ch1, ch2;
- ch1 = *(g_pen_editor_composition_input_box.current_text_p - 2);
- ch2 = *(g_pen_editor_composition_input_box.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- if (ch == 0x20)
- {
- i++;
- }
- if (i == g_pen_editor_composition_index)
- {
- for (i = 0; i < g_pen_editor_key_sequence.KeyLength + 1; i++)
- {
- gui_single_line_input_box_next(&g_pen_editor_composition_input_box);
- }
- break;
- }
- gui_single_line_input_box_next(&g_pen_editor_composition_input_box);
- }
- gui_single_line_input_box_previous(&g_pen_editor_composition_input_box);
- gui_single_line_input_box_highlight_cursor_number(
- &g_pen_editor_composition_input_box,
- g_pen_editor_key_sequence.KeyLength);
- //mmi_pen_editor_show_composition_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- num = mmi_ime_get_candidates_by_composition(
- g_pen_editor_syllable_table[g_pen_editor_composition_index],
- candidate_buffer);
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (i = 0; i < num; i++)
- {
- gui_single_line_input_box_insert_character(&gPenEditorCandidateInputBox, candidate_buffer[i]);
- }
- gui_single_line_input_box_goto_first_character(&gPenEditorCandidateInputBox);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS);
- }
- return num;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_cancel_handwriting
- * DESCRIPTION
- * Cancel the handwriting. This function is usually used when key down
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_cancel_handwriting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!gPenEditorFirstStroke)
- {
- int changed_height = 0;
- if (gPenEditorGDIHandler != NULL && *gPenEditorGDIHandler != GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(*gPenEditorGDIHandler);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_and_restore_active();
- }
- gui_cancel_timer(mmi_pen_editor_stroke_up_timer_handler);
- mmi_pen_begin_strokes_of_character();
- gdi_layer_lock_frame_buffer();
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- if (gPenEditorShowVK && (gPenEditorCandidateInputBox.y >= (PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM)))
- {
- /* W05.47 Change the Input Control Height when the VK is not Tray Type */
- if (!(GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type))
- {
- changed_height = gPenEditorCandidateInputBox.height;
- if (gPenEditorVKCandidate)
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- changed_height -= MMI_virtual_keyboard.height;
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX != gPenEditorInputBoxType)
- {
- mmi_pen_editor_resize_content_area(changed_height);
- }
- }
- }
- if (gPenEditorShowVK)
- {
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- if (gPenEditorVKCandidate)
- {
- if (gPenEditorShowVK)
- {
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- }
- mmi_pen_editor_hide_candidate_area();
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_handwriting_style
- * DESCRIPTION
- * Set the current handwriting Style
- * PARAMETERS
- * style [IN] PEN_EDITOR_HANDWRITING_STYLE_FULL_SCREEN : Handwriting on the full screen
- * PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK : Handwriting with Handwriting blocks
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_handwriting_style(mmi_pen_editor_handwriting_style_enum style)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_handwriting_style = style;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_handwriting_style
- * DESCRIPTION
- * To get the current handwriting style
- * PARAMETERS
- * void
- * RETURNS
- * PEN_EDITOR_HANDWRITING_STYLE_FULL_SCREEN : Handwriting on the full screen
- * PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK : Handwriting with Handwriting blocks
- *****************************************************************************/
- mmi_pen_editor_handwriting_style_enum mmi_pen_editor_get_handwriting_style(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_pen_editor_handwriting_style;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_multi_block_stroke_up_handler
- * DESCRIPTION
- * Draw the last point of the stroke and start the timer to check this is the last stroke or not if pos in the handwriting block
- * PARAMETERS
- * pos [IN] The position of the stroke up event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_multi_block_stroke_up_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int active_block;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- active_block = mmi_pen_editor_handwriting_check_block(pos);
- if (active_block)
- {
- mmi_pen_editor_stroke_move_handler(pos);
- gui_cancel_timer(mmi_pen_editor_stroke_up_timer_handler);
- /* The end of the stroke, if no more stroke in the period, the end of the character */
- gui_start_timer(PEN_EDITOR_CHARACTER_END_PERIOD, mmi_pen_editor_stroke_up_timer_handler);
- }
- gPenEditorPreviousPoint.x = -1;
- gPenEditorPreviousPoint.y = -1;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_handwriting_check_block
- * DESCRIPTION
- * To check the position is on which block (0 : out of handwriting area)
- * PARAMETERS
- * pos [IN] The position of the point to check
- * RETURNS
- * Which block the position is on
- *****************************************************************************/
- S32 mmi_pen_editor_handwriting_check_block(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- S32 active_block = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- 1,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + gPenEditorCandidateInputBox.height + 3,
- ((UI_device_width - 2) >> 1),
- PEN_EDITOR_BLOCK_HEIGHT - gPenEditorCandidateInputBox.height + 3);
- if (ret)
- {
- active_block = 1;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- 1 + ((UI_device_width - 2) >> 1),
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + gPenEditorCandidateInputBox.height + 3,
- ((UI_device_width - 2) >> 1),
- PEN_EDITOR_BLOCK_HEIGHT - gPenEditorCandidateInputBox.height + 3);
- if (ret)
- {
- active_block = 2;
- }
- return active_block;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_handwriting_direct_input
- * DESCRIPTION
- * Insert the recognizing result from handwriting to the input box directly
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_handwriting_direct_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[10];
- int num = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* The end of the character, pass the stroke data for hand writing recognization */
- gui_cancel_timer(mmi_pen_editor_stroke_up_timer_handler);
- mmi_pen_end_strokes_of_character();
- /* mmi_pen_end_strokes_of_character_with_dropping_last_point(); */
- #if defined(__MMI_HAND_WRITING_GET_STROKES__)
- mmi_pen_editor_save_stroke_to_file();
- #endif
- gdi_layer_push_and_set_active(*gPenEditorGDIHandler);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_and_restore_active();
- gPenEditorFirstStroke = MMI_TRUE;
- switch (MMI_current_input_mode)
- {
- #ifdef __MMI_LANG_TR_CHINESE__ //KP Jerry add on 2007-4-17
- case INPUT_MODE_TR_MULTITAP_BOPOMO:
- case INPUT_MODE_TR_BOPOMO:
- case INPUT_MODE_TR_STROKE:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_TRADITIONAL_CHINESE,
- 1);
- break;
- #endif/*__MMI_LANG_TR_CHINESE__*/ //KP Jerry add on 2007-4-17
- #ifdef __MMI_LANG_SM_CHINESE__ //KP Jerry add on 2007-4-17
- case INPUT_MODE_SM_MULTITAP_PINYIN:
- case INPUT_MODE_SM_PINYIN:
- case INPUT_MODE_SM_STROKE:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_SIMPLIFIED_CHINESE,
- 1);
- break;
- #endif/*__MMI_LANG_SM_CHINESE__*/ //KP Jerry add on 2007-4-17
- //KP Jerry add on 2007-4-17 start
- #ifdef __MMI_LANG_VIETNAMESE__
- case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_UPPER_CASE_ENGLISH,
- 1);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_LOWER_CASE_ENGLISH,
- 1);
- break;
- #endif /* __MMI_LANG_VIETNAMESE__ */
- #ifdef __MMI_LANG_RUSSIAN__
- case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
- case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_UPPER_CASE_ENGLISH,
- 1);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
- case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_LOWER_CASE_ENGLISH,
- 1);
- break;
- #endif /* __MMI_LANG_RUSSIAN__ */
- #ifdef __MMI_LANG_THAI__
- case INPUT_MODE_MULTITAP_THAI:
- case INPUT_MODE_SMART_THAI:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_UPPER_CASE_ENGLISH,
- 1);
- break;
- #endif /* __MMI_LANG_THAI__ */
- //KP Jerry add on 2007-4-17 end
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
- case INPUT_MODE_SMART_UPPERCASE_ABC:
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_UPPER_CASE_ENGLISH,
- 1);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
- case INPUT_MODE_SMART_LOWERCASE_ABC:
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_LOWER_CASE_ENGLISH,
- 1);
- break;
- case INPUT_MODE_123:
- case INPUT_MODE_123_SYMBOLS:
- num = mmi_pen_editor_hand_writing_get_candidates(
- (U16*) gPenEditorStrokeBuffer,
- candidate_buffer,
- PEN_EDITOR_NUMBER,
- 1);
- break;
- default:
- break;
- }
- if (num)
- {
- mmi_pen_editor_input_character(candidate_buffer[0], MMI_FALSE);
- }
- g_pen_editor_active_block = 0;
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_begin_strokes_of_character();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_draw_handwriting_block
- * DESCRIPTION
- * To draw the handwriting block area
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_draw_handwriting_block(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT - 2,
- UI_device_width - 1,
- MMI_content_y + MMI_content_height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT - 2,
- UI_device_width - 1,
- MMI_content_y + MMI_content_height - 1,
- c);
- }
- gdi_draw_rect(
- 1,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + gPenEditorCandidateInputBox.height + 3,
- UI_device_width - 2,
- MMI_content_y + MMI_content_height - 1,
- GDI_COLOR_BLACK);
- gdi_draw_line(
- 1 + ((UI_device_width - 2) >> 1),
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + gPenEditorCandidateInputBox.height + 3,
- 1 + ((UI_device_width - 2) >> 1),
- MMI_content_y + MMI_content_height - 1,
- GDI_COLOR_BLACK);
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 1);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_LSK_and_RSK_state
- * DESCRIPTION
- * Reset LSK and RSK label and function to un-selected state
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_LSK_and_RSK_state(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorSelectCandidate)
- {
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- /* LSK */
- register_EMS_inputbox_keys();
- /* RSK */
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- /* LSK */
- register_multiline_inputbox_keys();
- /* RSK */
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- break;
- default:
- break;
- }
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_FALSE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_enable_multi_block_handwriting
- * DESCRIPTION
- * Change from the main virtual keybaord mode to the multi-block handwriting mode. Enable the stroke mode.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_enable_multi_block_handwriting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- U16 input_type_only = MMI_current_input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_editor_hide_virtual_keyboard_area();
- changed_height = gPenEditorCandidateInputBox.height;
- if (changed_height < MMI_virtual_keyboard.height)
- {
- changed_height = MMI_virtual_keyboard.height;
- if (gPenEditorVKCandidate)
- {
- changed_height += (gPenEditorCandidateInputBox.height + 1);
- }
- gPenEditorVKCandidate = MMI_FALSE;
- }
- changed_height -= PEN_EDITOR_BLOCK_HEIGHT;
- gui_reset_clip();
- mmi_pen_editor_resize_content_area(changed_height);
- mmi_pen_editor_draw_handwriting_block();
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- s32 temp_multiline_height = MMI_multiline_inputbox.height;
- MMI_BOOL temp_VKCandidate = gPenEditorVKCandidate;
- gui_virtual_keyboard_language_enum keyboard_type = MMI_virtual_keyboard.lang_type;
- mmi_pen_editor_vk_list_menu_resize();
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- redraw_fixed_list();
- redraw_current_inline_item();
- gPenEditorVKCandidate = temp_VKCandidate;
- }
- wgui_setup_virtual_keyboard(keyboard_type);
- }
- wgui_move_virtual_keyboard(
- MMI_virtual_keyboard.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 3);
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- if (!(INPUT_TYPE_NUMERIC_PASSWORD == input_type_only ||
- INPUT_TYPE_SAT_NUMERIC_PASSWORD == input_type_only) && (!g_pen_editor_disable_handwriting))
- {
- g_multi_block_stroke_area[0].x1 = 3;
- g_multi_block_stroke_area[0].y1 =
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
- mmi_pen_editor_compute_candidate_input_box_height() + 4;
- g_multi_block_stroke_area[0].x2 = (UI_device_width >> 1) - 2;
- g_multi_block_stroke_area[0].y2 = MMI_content_y + MMI_content_height - 3;
- g_multi_block_stroke_area[1].x1 = (UI_device_width >> 1) + 1;
- g_multi_block_stroke_area[1].y1 =
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
- mmi_pen_editor_compute_candidate_input_box_height() + 4;
- g_multi_block_stroke_area[1].x2 = UI_device_width - 3;
- g_multi_block_stroke_area[1].y2 = MMI_content_y + MMI_content_height - 3;
- gPenEditorEnableHandWriting = MMI_TRUE;
- mmi_pen_start_capture_strokes(
- PEN_EDITOR_STROKE_BUFFER_SIZE,
- gPenEditorStrokeBuffer,
- 2,
- g_multi_block_stroke_area,
- NULL);
- memcpy(
- &g_pen_editor_original_handwriting_area,
- &g_multi_block_stroke_area,
- sizeof(mmi_pen_handwriting_area_struct));
- /*
- * 06.38 Fixing LSK/RSK didnt be properly set when changing state
- * from Virtual Keyboard to Multi-Block HandWriting in the case of
- * Candidate Inputbox in selection state.
- */
- mmi_pen_editor_reset_LSK_and_RSK_state();
- mmi_pen_register_stroke_down_handler(mmi_pen_editor_multi_block_stroke_down_handler);
- mmi_pen_register_stroke_move_handler(NULL, NULL, mmi_pen_editor_multi_block_stroke_move_handler);
- mmi_pen_register_stroke_up_handler(mmi_pen_editor_multi_block_stroke_up_handler);
- mmi_pen_editor_hand_writing_initailize();
- mmi_pen_begin_strokes_of_character();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_disable_multi_block_handwriting
- * DESCRIPTION
- * Change Multi-Block handwriting to the main virtual keyboard mode. Disable the stroke mode.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_disable_multi_block_handwriting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_stop_capture_strokes();
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- changed_height = MMI_virtual_keyboard.height;
- mmi_pen_editor_set_virtual_keyboard_by_input_mode(MMI_current_input_mode);
- changed_height -= MMI_virtual_keyboard.height;
- mmi_pen_editor_resize_content_area(changed_height);
- RedrawCategoryControlledArea200Screen(NULL);
- return;
- }
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- changed_height = PEN_EDITOR_BLOCK_HEIGHT;
- //KP Jerry modify on 2007-4-17 start
- if (INPUT_MODE_MULTITAP_LOWERCASE_ABC == MMI_current_input_mode || //KP Jerry remove "else" for adjust them order on 2007-4-16
- INPUT_MODE_SMART_LOWERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- else if (INPUT_MODE_123 == MMI_current_input_mode ||
- INPUT_MODE_123_SYMBOLS == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- }
- #ifdef __MMI_LANG_TR_CHINESE__ //KP Jerry add on 2007-4-16
- else if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode || INPUT_MODE_TR_BOPOMO == MMI_current_input_mode) //KP Jerry delete "INPUT_MODE_TR_STROKE == MMI_current_input_mode" on 2007-3-21
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- }
- //KP Jerry add on 2007-3-21 start
- else if(INPUT_MODE_TR_STROKE==MMI_current_input_mode)
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- //KP Jerry add on 2007-3-21 end
- #endif/*__MMI_LANG_TR_CHINESE__*/ //KP Jerry add on 2007-4-16
- #ifdef __MMI_LANG_SM_CHINESE__ //KP Jerry add on 2007-4-16
- else if (INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode || INPUT_MODE_SM_PINYIN == MMI_current_input_mode) //KP Jerry delete "INPUT_MODE_SM_STROKE == MMI_current_input_mode" on 2007-3-21
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- }
- //KP Jerry add on 2007-3-21 start
- else if(INPUT_MODE_SM_STROKE==MMI_current_input_mode)
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- //KP Jerry add on 2007-3-21 end
- #endif/*__MMI_LANG_SM_CHINESE__*/ //KP Jerry add on 2007-4-16
- //KP Jerry add on 2007-4-16 start
- #ifdef __MMI_LANG_VIETNAMESE__
- else if (INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE == MMI_current_input_mode ||
- INPUT_MODE_SMART_LOWERCASE_VIETNAMESE == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE == MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_VIETNAMESE == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- #endif
- #ifdef __MMI_LANG_RUSSIAN__
- else if (INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN == MMI_current_input_mode ||
- INPUT_MODE_SMART_LOWERCASE_RUSSIAN == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN== MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_RUSSIAN == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN_UPPERCASE);
- }
- #endif
- #ifdef __MMI_LANG_THAI__
- else if (INPUT_MODE_MULTITAP_THAI == MMI_current_input_mode ||
- INPUT_MODE_SMART_THAI == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE );
- }
- #endif
- //KP Jerry add on 2007-4-16 end
- //KP Jerry modify on 2007-4-17 end
- if (gPenEditorCandidateInputBox.height > MMI_virtual_keyboard.height)
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- else
- {
- changed_height -= MMI_virtual_keyboard.height;
- }
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_resize_content_area(changed_height);
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- s32 temp_multiline_height = MMI_multiline_inputbox.height;
- MMI_BOOL temp_VKCandidate = gPenEditorVKCandidate;
- gui_virtual_keyboard_language_enum keyboard_type = MMI_virtual_keyboard.lang_type;
- mmi_pen_editor_vk_list_menu_resize();
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- redraw_fixed_list();
- redraw_current_inline_item();
- gPenEditorVKCandidate = temp_VKCandidate;
- }
- wgui_setup_virtual_keyboard(keyboard_type);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- if (gPenEditorVKCandidate)
- {
- mmi_pen_editor_hide_candidate_area();
- }
- gdi_layer_unlock_frame_buffer();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_multi_block_stroke_down_handler
- * DESCRIPTION
- * When receiving the stroke down event, do the related action according to the current situation
- * PARAMETERS
- * pos [IN] The position of the stroke down event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_multi_block_stroke_down_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height;
- S32 active_block = 0;
- /*----------------------------------------------------------------*/
- /* Local Variables Initializing */
- /*----------------------------------------------------------------*/
- changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- mmi_pen_editor_smart_latin_confirm_select();
- mmi_pen_editor_set_left_soft_key();
- }
- if (g_pen_editor_composition_state.candidate_state != PEN_EDITOR_CANDIDATE_OFF)
- {
- int change_height = 0;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- change_height += g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- mmi_pen_editor_reset_key_sequence(&g_pen_editor_key_sequence);
- }
- /* create new layer for stroke through Draw Manager */
- if (gPenEditorGDIHandler == NULL || *gPenEditorGDIHandler == GDI_ERROR_HANDLE)
- {
- gPenEditorStrokeGDIBuffer = (U8*) mmi_frm_scrmem_alloc(handwriting_stroke_layer_mem);
- MMI_ASSERT(gPenEditorStrokeGDIBuffer);
- if (GDI_LAYER_SUCCEED != dm_create_layer_using_outside_memory(
- 0,
- 0,
- UI_device_width,
- UI_device_height,
- &gPenEditorGDIHandler,
- (U8*) gPenEditorStrokeGDIBuffer,
- handwriting_stroke_layer_mem,
- DM_LAYER_TOP))
- {
- MMI_ASSERT(0);
- }
- gdi_layer_push_and_set_active(*gPenEditorGDIHandler);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_and_restore_active();
- }
- /* If the state requires confirm, confirm it directly in this situation// */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gPenEditorShowVK = MMI_FALSE;
- mmi_pen_editor_confirm_selection();
- mmi_pen_editor_hide_candidate_area();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- active_block = mmi_pen_editor_handwriting_check_block(pos);
- if (g_pen_editor_active_block)
- {
- if (g_pen_editor_active_block != active_block)
- {
- mmi_pen_editor_handwriting_direct_input();
- }
- }
- g_pen_editor_active_block = active_block;
- if (!g_pen_editor_active_block)
- {
- g_pen_editor_active_block = 0;
- }
- /* Clear Virtual Keyboard Area only at the first stroke */
- if (gPenEditorFirstStroke)
- {
- gPenEditorFirstStroke = MMI_FALSE;
- }
- gPenEditorShowVK = MMI_TRUE;
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- gPenEditorPreviousPoint.x = pos.x;
- gPenEditorPreviousPoint.y = pos.y;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_multi_block_stroke_move_handler
- * DESCRIPTION
- * Draw the stroke when moving the pen in the stroke mode and check the stroke is out of the current block or not.
- * If yes, pass the stroke buffer to the handwriting module for recognizing
- * PARAMETERS
- * pos [IN] The position of the stroke move event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_multi_block_stroke_move_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 active_block = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- active_block = mmi_pen_editor_handwriting_check_block(pos);
- if (active_block)
- {
- S32 previous_block = mmi_pen_editor_handwriting_check_block(gPenEditorPreviousPoint);
- if (active_block == previous_block)
- {
- gdi_layer_lock_frame_buffer();
- gdi_layer_push_and_set_active(*gPenEditorGDIHandler);
- gdi_layer_push_clip();
- /* Draw the point of the stroke */
- gui_line(gPenEditorPreviousPoint.x, gPenEditorPreviousPoint.y, pos.x, pos.y, gPenEditorStrokeColor);
- gui_line(gPenEditorPreviousPoint.x + 1, gPenEditorPreviousPoint.y, pos.x + 1, pos.y, gPenEditorStrokeColor);
- gui_line(gPenEditorPreviousPoint.x, gPenEditorPreviousPoint.y + 1, pos.x, pos.y + 1, gPenEditorStrokeColor);
- gui_line(gPenEditorPreviousPoint.x - 1, gPenEditorPreviousPoint.y, pos.x - 1, pos.y, gPenEditorStrokeColor);
- gui_line(gPenEditorPreviousPoint.x, gPenEditorPreviousPoint.y - 1, pos.x, pos.y - 1, gPenEditorStrokeColor);
- gdi_layer_pop_clip();
- gdi_layer_pop_and_restore_active();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- PEN_MIN(gPenEditorPreviousPoint.x, pos.x) - 1,
- PEN_MIN(gPenEditorPreviousPoint.y, pos.y) - 1,
- PEN_MAX(gPenEditorPreviousPoint.x, pos.x) + 1,
- PEN_MAX(gPenEditorPreviousPoint.y, pos.y) + 1);
- }
- gPenEditorPreviousPoint.x = pos.x;
- gPenEditorPreviousPoint.y = pos.y;
- }
- if (g_pen_editor_active_block)
- {
- if (g_pen_editor_active_block != active_block)
- {
- mmi_pen_editor_handwriting_direct_input();
- if (active_block)
- {
- gPenEditorFirstStroke = MMI_FALSE;
- }
- }
- }
- g_pen_editor_active_block = active_block;
- if (!g_pen_editor_active_block)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- }
- else
- {
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- }
- }
- void mmi_pen_editor_inline_full_screen_redraw_handwriting_area(void)
- {
- /* W06.05 Fix Background display issue in virtual keyboard */
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style()&&
- (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER == MMI_virtual_keyboard.lang_type))
- {
- mmi_pen_editor_draw_handwriting_block();
- }
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */