EditorPen.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:513k
源码类别:
MTK
开发平台:
C/C++
- /* If the state requires confirm, confirm it directly in this situation// */
- if (gPenEditorSelectCandidate && (gPenEditorCandidateInputBox.y >= (PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM)))
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gPenEditorShowVK = MMI_FALSE;
- mmi_pen_editor_confirm_selection();
- mmi_pen_editor_hide_candidate_area();
- }
- /* Clear Virtual Keyboard Area only at the first stroke */
- if (gPenEditorFirstStroke)
- {
- gPenEditorFirstStroke = MMI_FALSE;
- /* Clear Virtual Keyboard Text */
- if (gPenEditorVKText.TextLength > 0 || gPenEditorSelectCandidate)
- {
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- 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);
- }
- if (gPenEditorShowVK)
- {
- mmi_pen_editor_hide_virtual_keyboard_area();
- }
- }
- /* W05.44 Change the Input Control Height when the VK is not Tray Type */
- if ((PEN_EDITOR_VK_ON == gPenEditorVKState) &&
- !(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))
- {
- /* Resize the content area for candidate input box if needed// */
- changed_height = MMI_virtual_keyboard.height;
- if (!gPenEditorVKCandidate)
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- if (gPenEditorShowVK)
- {
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX != gPenEditorInputBoxType)
- {
- mmi_pen_editor_resize_content_area(changed_height);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- (PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM));
- }
- }
- gPenEditorShowVK = MMI_TRUE;
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- gPenEditorPreviousPoint.x = pos.x;
- gPenEditorPreviousPoint.y = pos.y;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_stroke_move_handler
- * DESCRIPTION
- * Draw the stroke when moving the pen in the stroke mode
- * PARAMETERS
- * pos [IN] The position of the stroke move event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_stroke_move_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- 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;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_stroke_up_handler
- * DESCRIPTION
- * Draw the last point of the stroke and start the timer to check this is the last stroke or not
- * PARAMETERS
- * pos [IN] The position of the stroke up event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_stroke_up_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- mmi_pen_editor_stroke_move_handler(pos);
- gPenEditorPreviousPoint.x = -1;
- gPenEditorPreviousPoint.y = -1;
- 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);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_stroke_up_timer_handler
- * DESCRIPTION
- * If no more stroke, then pass the strokes to the handwiritng module to get candidates
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_stroke_up_timer_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL has_unfinished_stroke;
- int num = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- mmi_pen_peek_stroke_state(&has_unfinished_stroke);
- if (!has_unfinished_stroke)
- {
- /* The end of the character, pass the stroke data for hand writing recognization */
- mmi_pen_end_strokes_of_character();
- #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;
- gdi_layer_lock_frame_buffer();
- num = mmi_pen_editor_get_candidates_from_hand_writing();
- gdi_layer_unlock_frame_buffer();
- /* W05.36 Check the Candidates List, if empty, just clear stroke */
- if (num == 0)
- {
- int changed_height = 0;
- 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;
- }
- /* According different input box, do different actions */
- mmi_pen_editor_input_character(gPenEditorCandidateBuffer[0], MMI_TRUE);
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_store_LSK_Text();
- mmi_pen_editor_set_left_soft_key_select();
- /* W05.32 Fix LSK issue in in-line multiline input box */
- if (softkey_functions[MMI_LEFT_SOFTKEY][KEY_EVENT_UP] != mmi_pen_editor_left_soft_key_handler)
- {
- mmi_pen_editor_set_inputbox_LSK_Function(softkey_functions[MMI_LEFT_SOFTKEY][KEY_EVENT_UP]);
- }
- 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);
- #if !defined(__MMI_HANDWRITING_PAD__)
- gui_start_timer(PEN_EDITOR_CONFIRM_PERIOD, mmi_pen_editor_confirm_selection);
- #endif
- mmi_pen_begin_strokes_of_character();
- g_pen_editor_active_block = 0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_confirm_selection
- * DESCRIPTION
- * When the candidate input box is on, confirm the selection and update the state by its situation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_confirm_selection(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- if (!gPenEditorEnableHandWriting)
- {
- MMI_DBG_ASSERT(0);
- return;
- }
- /* gPenEditorShowVK to avoid clear the virtual keyboard area in some situation */
- if (gPenEditorSelectCandidate)
- {
- gdi_layer_lock_frame_buffer();
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- wgui_singleline_inputbox_RSK_label_clear = 0;
- singleline_inputbox_multitap_input_complete();
- wgui_set_singleline_RSK();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- inline_edit_singleline_inputbox_multitap_input_complete();
- mmi_pen_editor_set_right_soft_key_inline_text();
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- set_right_softkey_label(wgui_inline_edit_get_RSK_string());
- set_right_softkey_icon(NULL);
- register_right_softkey_handler();
- set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
- redraw_right_softkey();
- break;
- default:
- break;
- }
- mmi_pen_editor_hide_candidate_area();
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- if (gPenEditorShowVK && (gPenEditorCandidateInputBox.y >= (PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM)))
- {
- if (PEN_EDITOR_CANDIDATE_OFF != g_pen_editor_composition_state.candidate_state)
- {
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- changed_height += gPenEditorCandidateInputBox.height;
- mmi_pen_editor_reset_key_sequence(&g_pen_editor_key_sequence);
- }
- /* 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)
- {
- /* W05.48 If vk text is null, clear it */
- if (gPenEditorVKText.TextLength > 0)
- {
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_TRUE);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- }
- mmi_pen_editor_hide_candidate_area();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- if (gPenEditorShowVK)
- {
- mmi_pen_editor_change_handwriting_area();
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- else
- {
- return;
- }
- /* According different input box, do different action */
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- multiline_inputbox_multitap_input_complete();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- EMS_inputbox_multitap_input_complete();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- singleline_inputbox_multitap_input_complete();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- inline_edit_singleline_inputbox_multitap_input_complete();
- break;
- case PEN_EDITOR_DATE:
- date_input_next_character();
- break;
- case PEN_EDITOR_IP4:
- IP4_input_next_character();
- break;
- case PEN_EDITOR_TIME:
- time_input_next_character();
- break;
- case PEN_EDITOR_TIME_PERIOD:
- time_period_input_next_character();
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_from_hand_writing
- * DESCRIPTION
- * Get the candidates from the handwriting module
- * PARAMETERS
- * void
- * RETURNS
- * The number of the candidates
- *****************************************************************************/
- int mmi_pen_editor_get_candidates_from_hand_writing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- int num = 0, i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_current_input_mode)
- {
- #ifdef __MMI_LANG_TR_CHINESE__ //KP Jerry add on 2007-4-18
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- #endif /*__MMI_LANG_TR_CHINESE__*/ //KP Jerry add on 2007-4-18
- #ifdef __MMI_LANG_SM_CHINESE__ //KP Jerry add on 2007-4-18
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- #endif /*__MMI_LANG_SM_CHINESE__*/ //KP Jerry add on 2007-4-18
- //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,
- PEN_EDITOR_CANDIDATE_SIZE);
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- #endif
- #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,
- PEN_EDITOR_CANDIDATE_SIZE);
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- #endif
- #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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- #endif
- //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,
- PEN_EDITOR_CANDIDATE_SIZE);
- /* W05.33 For candidates sorting issue */
- mmi_pen_editor_resort_candidates(candidate_buffer, num, PEN_EDITOR_SORT_CAPITAL_FIRST);
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- /* W05.33 For candidates sorting issue */
- mmi_pen_editor_resort_candidates(candidate_buffer, num, PEN_EDITOR_SORT_NON_CAPITAL_FIRST);
- 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,
- PEN_EDITOR_CANDIDATE_SIZE);
- break;
- default:
- break;
- }
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- /* W05.36 Check the Candidates List, if empty return 0 */
- if (0 == num)
- {
- return 0;
- }
- {
- /* W05.33 Fix numeric_leading_zero issue make sure that the first candidate can be '0' */
- U8 temp = numeric_leading_zero;
- set_leading_zero(TRUE);
- for (; i < num; i++)
- {
- gui_single_line_input_box_insert_character(&gPenEditorCandidateInputBox, candidate_buffer[i]);
- }
- set_leading_zero(temp);
- }
- gui_single_line_input_box_goto_first_character(&gPenEditorCandidateInputBox);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_virtual_keyboard_area();
- mmi_pen_editor_show_candidate_area(MMI_FALSE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return num;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_input_selection_character
- * DESCRIPTION
- * Empty Function
- * PARAMETERS
- * c [IN] The character to input
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_input_selection_character(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_check_input
- * DESCRIPTION
- * Check the character is able to input or not
- * PARAMETERS
- * c [IN] The character to check
- * RETURNS
- * MMI_TRUE : yes
- * MMI_FALSE : no
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_check_input(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (test_change_input_mode)
- {
- if (0 == test_change_input_mode() && UI_TEST_UCS2_CHARACTER(c))
- {
- return MMI_FALSE;
- }
- }
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_down_handler
- * DESCRIPTION
- * According to the control which pen down on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen down event
- * RETURNS
- * void
- *****************************************************************************/
- #if !defined(__MMI_HANDWRITING_PAD__)
- void mmi_pen_editor_pen_down_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 no_of_control_set = 0;
- gui_single_line_input_box_pen_enum single_line_input_box_event;
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- gui_pen_event_param_struct vk_para;
- gui_virtual_keyboard_pen_enum vk_event;
- S32 multitap_index = 0;
- BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (!gPenEditorFirstStroke && (g_pen_editor_active_block != mmi_pen_editor_handwriting_check_block(pos)))
- {
- mmi_pen_editor_handwriting_direct_input();
- }
- else if (!gPenEditorFirstStroke && g_pen_editor_active_block)
- {
- gui_start_timer(PEN_EDITOR_CHARACTER_END_PERIOD, mmi_pen_editor_stroke_up_timer_handler);
- }
- }
- for (; no_of_control_set < gPenEditorControlSet.NumberofControlSets; no_of_control_set++)
- {
- switch (gPenEditorControlSet.PenEditorControlSet[no_of_control_set])
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- /* W06.11 Check information bar range according to gPenEditorInputBoxType */
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_INLINE_TEXT:
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- wgui_inputbox_information_bar_x,
- wgui_inputbox_information_bar_y,
- wgui_inputbox_information_bar_width,
- wgui_inputbox_information_bar_height);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- wgui_EMS_inputbox_information_bar_x,
- wgui_EMS_inputbox_information_bar_y,
- wgui_EMS_inputbox_information_bar_width,
- wgui_EMS_inputbox_information_bar_height);
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- break;
- default:
- break;
- }
- if (ret)
- {
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_INFORMATION_BAR;
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- if (MMI_multiline_inputbox.n_lines > PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_LINES)
- {
- gui_multi_line_input_box_set_pen_scroll_delay(
- &MMI_multiline_inputbox,
- PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_SCROLL_DELAY);
- }
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- if (ret)
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- if (MMI_EMS_inputbox.n_lines > PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_LINES)
- {
- gui_EMS_input_box_set_pen_scroll_delay(
- &MMI_EMS_inputbox,
- PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_SCROLL_DELAY);
- }
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- if (ret)
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_EMS_INPUT_BOX;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- if (MMI_multiline_inputbox.n_lines > PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_LINES)
- {
- gui_multi_line_input_box_set_pen_scroll_delay(
- &MMI_multiline_inputbox,
- PEN_EDITOR_GUI_MULTI_LINE_INPUT_BOX_SCROLL_DELAY);
- }
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- if (ret)
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- ret = gui_single_line_input_box_translate_pen_event(
- &MMI_singleline_inputbox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- ret = gui_single_line_input_box_translate_pen_event(
- &MMI_inline_singleline_inputbox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_INLINE_TEXT;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_DATE:
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, current_date_input->x, current_date_input->y, current_date_input->width,
- current_date_input->height))
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_DATE;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_IP4:
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, current_IP4_input->x, current_IP4_input->y, current_IP4_input->width,
- current_IP4_input->height))
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_IP4;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_TIME:
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, current_time_input->x, current_time_input->y, current_time_input->width,
- current_time_input->height))
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_TIME;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, current_time_period_input->x, current_time_period_input->y,
- current_time_period_input->width, current_time_period_input->height))
- {
- /* W05.45 Temp Solution for Pen Down When Selecting Candidates */
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_TIME_PERIOD;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- if (PEN_EDITOR_VK_ON == gPenEditorVKState)
- {
- ret = gui_virtual_keyboard_translate_pen_event(
- &MMI_virtual_keyboard,
- pos.x,
- pos.y,
- MMI_PEN_EVENT_DOWN,
- &vk_event,
- &vk_para);
- }
- else
- {
- break;
- }
- if (ret)
- {
- switch (vk_event)
- {
- case GUI_VKBD_PEN_BAKSPACE:
- break;
- case GUI_VKBD_PEN_BRACKET:
- break;
- case GUI_VKBD_PEN_CAPSLOCK:
- break;
- case GUI_VKBD_PEN_CHAR_I:
- break;
- case GUI_VKBD_PEN_DISPLAY_AREA:
- break;
- case GUI_VKBD_PEN_HIDE:
- break;
- case GUI_VKBD_PEN_NEWLINE:
- break;
- case GUI_VKBD_PEN_NONE:
- break;
- case GUI_VKBD_PEN_SHOW:
- break;
- case GUI_VKBD_PEN_SPACE:
- break;
- case GUI_VKBD_PEN_SYMBPICKER:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- if (PEN_EDITOR_CANDIDATE_OFF != g_pen_editor_composition_state.candidate_state)
- {
- ret = gui_single_line_input_box_translate_pen_event(
- &g_pen_editor_composition_input_box,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_CONTROL;
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_COMPOSITION_AREA;
- gui_show_single_line_input_box_ext(&g_pen_editor_composition_input_box, pos.x, pos.y);
- gdi_layer_lock_frame_buffer();
- /* /TODO : Jump to the index */
- if ((INPUT_MODE_TR_BOPOMO == MMI_current_input_mode ||
- INPUT_MODE_SM_PINYIN == MMI_current_input_mode) &&
- PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == g_pen_editor_composition_state.candidate_state)
- {
- g_pen_editor_composition_index = mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_position();
- mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index(g_pen_editor_composition_index);
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- if (g_pen_editor_composition_state.arrow_enable)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x - (((g_pen_editor_composition_input_box.grid_width << 1) + g_pen_editor_composition_input_box.grid_width) >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_LEFT_ARROW;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_COMPOSITION_AREA;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_composition_area();
- gui_show_single_line_input_box(&g_pen_editor_composition_input_box);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_composition_state.left_arrow_state)
- {
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_composition_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_composition_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x + g_pen_editor_composition_input_box.width + (g_pen_editor_composition_input_box.grid_width >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_RIGHT_ARROW;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_COMPOSITION_AREA;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_composition_area();
- gui_show_single_line_input_box(&g_pen_editor_composition_input_box);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_composition_state.right_arrow_state)
- {
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_composition_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_composition_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- 0,
- g_pen_editor_composition_input_box.y,
- UI_device_width,
- g_pen_editor_composition_input_box.height);
- if (ret)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_OUT_OF_RANGE;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_COMPOSITION_AREA;
- return;
- }
- }
- }
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- if (gPenEditorSelectCandidate)
- {
- g_pen_editor_candidate_state.selected_candidate = 0;
- ret = gui_single_line_input_box_translate_pen_event(
- &gPenEditorCandidateInputBox,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- UI_character_type ch, ch1, ch2;
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_CONTROL;
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_CANDIDATE_AREA;
- gui_show_single_line_input_box_ext(&gPenEditorCandidateInputBox, pos.x, pos.y);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- ch1 = *(gPenEditorCandidateInputBox.current_text_p - 2);
- ch2 = *(gPenEditorCandidateInputBox.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- g_pen_editor_candidate_state.selected_candidate = ch;
- if (mmi_pen_editor_check_input(ch))
- {
- gdi_layer_lock_frame_buffer();
- switch (gPenEditorInputBoxType)
- {
- /* W05.32 Fix typo error */
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- multiline_inputbox_multitap_input(ch);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- EMS_inputbox_multitap_input(ch);
- break;
- case PEN_EDITOR_INLINE_TEXT:
- inline_edit_singleline_inputbox_multitap_input(ch);
- break;
- default:
- break;
- }
- mmi_pen_editor_show_candidate_area(
- g_pen_editor_candidate_state.arrow_enable,
- g_pen_editor_candidate_state.candidate_state);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- else
- {
- /* W06.16 Play warning tone when inserting characters is valid */
- UI_editor_play_tone_cannot_insert();
- return;
- }
- }
- if (g_pen_editor_candidate_state.arrow_enable)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x - (((gPenEditorCandidateInputBox.grid_width << 1) + gPenEditorCandidateInputBox.grid_width) >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_LEFT_ARROW;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_CANDIDATE_AREA;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&gPenEditorCandidateInputBox);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_candidate_state.left_arrow_state)
- {
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_candidate_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_candidate_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x + gPenEditorCandidateInputBox.width + (gPenEditorCandidateInputBox.grid_width >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_RIGHT_ARROW;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_CANDIDATE_AREA;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&gPenEditorCandidateInputBox);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_candidate_state.right_arrow_state)
- {
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_candidate_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_candidate_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- 0,
- gPenEditorCandidateInputBox.y,
- UI_device_width,
- gPenEditorCandidateInputBox.height);
- if (ret)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_OUT_OF_RANGE;
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_CANDIDATE_AREA;
- return;
- }
- }
- }
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- if (ret)
- {
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_IME_BUTTON;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- if (MMI_TRUE == gPenEditorMultitapInputState)
- {
- ret = gui_multitap_input_translate_pen_position(
- gPenEditorMultitapInput,
- pos.x,
- pos.y,
- &multitap_index);
- }
- if (ret)
- {
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_MULTITAP;
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- if (MMI_FALSE == ret)
- {
- //W05.43 Temp Solution for Switch Input Method Without Complete Selecting Candidate
- //W05.45 Temp Solution for Pen Down When Selecting Candidates
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_NONE;
- wgui_general_pen_down_hdlr(pos);
- if (gPenEditorSelectCandidate && !g_pen_editor_hold_confirm)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_up_handler
- * DESCRIPTION
- * According to the control which pen up on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen up event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_up_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* S32 no_of_control_set = 0; */
- gui_single_line_input_box_pen_enum single_line_input_box_event;
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- gui_pen_event_param_struct vk_para;
- gui_virtual_keyboard_pen_enum vk_event;
- BOOL ret = MMI_FALSE;
- S32 multitap_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.09 Confirm Selection before moving cursor or switching input method */
- switch (gPenEditorActiveControl)
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- /* W06.11 Check information bar range according to gPenEditorInputBoxType */
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_INLINE_TEXT:
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- wgui_inputbox_information_bar_x,
- wgui_inputbox_information_bar_y,
- wgui_inputbox_information_bar_x + wgui_information_bar_input_mode_display_width,
- wgui_inputbox_information_bar_height);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- wgui_EMS_inputbox_information_bar_x,
- wgui_EMS_inputbox_information_bar_y,
- wgui_EMS_inputbox_information_bar_x + wgui_information_bar_input_mode_display_width,
- wgui_EMS_inputbox_information_bar_height);
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- break;
- default:
- break;
- }
- if (!ret)
- {
- break;
- }
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- mmi_pen_editor_switch_input_method();
- if (ret)
- {
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- if (ret)
- {
- if (gPenEditorSelectCandidate && gPenEditorVKText.TextLength == 0)
- {
- mmi_pen_editor_confirm_selection();
- }
- if (GUI_MULTI_LINE_INPUT_BOX_PEN_SCROLL_BAR != multi_line_input_box_event)
- {
- gui_show_multi_line_input_box_ext(&MMI_multiline_inputbox, pos.x, pos.y);
- redraw_multiline_inputbox();
- }
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- if (ret)
- {
- if (gPenEditorSelectCandidate && gPenEditorVKText.TextLength == 0)
- {
- mmi_pen_editor_confirm_selection();
- }
- if (GUI_EMS_INPUT_BOX_PEN_SCROLL_BAR != EMS_input_box_event)
- {
- gui_show_EMS_input_box_ext(&MMI_EMS_inputbox, pos.x, pos.y);
- wgui_EMS_set_text_format(MMI_EMS_inputbox.text_format);
- redraw_EMS_inputbox();
- }
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- if (ret)
- {
- if (gPenEditorSelectCandidate && gPenEditorVKText.TextLength == 0)
- {
- mmi_pen_editor_confirm_selection();
- }
- if (GUI_MULTI_LINE_INPUT_BOX_PEN_SCROLL_BAR != multi_line_input_box_event)
- {
- gui_show_multi_line_input_box_ext(&MMI_multiline_inputbox, pos.x, pos.y);
- }
- redraw_multiline_inputbox();
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- ret = gui_single_line_input_box_translate_pen_event(
- &MMI_singleline_inputbox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- gui_show_single_line_input_box_ext(&MMI_singleline_inputbox, pos.x, pos.y);
- /* W06.15 Reloacate Curesor after moving cursor by pen */
- gui_single_line_input_box_locate_cursor(&MMI_singleline_inputbox);
- redraw_singleline_inputbox();
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- ret = gui_single_line_input_box_translate_pen_event(
- &MMI_inline_singleline_inputbox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- gui_show_single_line_input_box_ext(&MMI_inline_singleline_inputbox, pos.x, pos.y);
- /* W06.15 Reloacate Curesor after moving cursor by pen */
- gui_single_line_input_box_locate_cursor(&MMI_inline_singleline_inputbox);
- show_inline_singleline_inputbox();
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_DATE:
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- date_input_move_to_x_y(current_date_input, pos.x, pos.y);
- if (ret)
- {
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_IP4:
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- IP4_input_move_to_x_y(current_IP4_input, pos.x, pos.y);
- if (ret)
- {
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_TIME:
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- time_input_move_to_x_y(current_time_input, pos.x, pos.y);
- if (ret)
- {
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- time_period_input_move_to_x_y(current_time_period_input, pos.x, pos.y);
- if (ret)
- {
- return;
- }
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- ret = gui_virtual_keyboard_translate_pen_event(
- &MMI_virtual_keyboard,
- pos.x,
- pos.y,
- MMI_PEN_EVENT_UP,
- &vk_event,
- &vk_para);
- //Jerry add on 2007-4-24 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if(GUI_VIRTUAL_KEYBOARD_SYMBOL==MMI_virtual_keyboard.lang_type
- &&(INPUT_MODE_TR_STROKE==MMI_current_input_mode
- ||INPUT_MODE_SM_STROKE==MMI_current_input_mode)
- && gPenEditorVKCandidate)
- {
- mmi_pen_editor_hide_candidate_area();
- }
- #endif
- //Jerry add on 2007-4-24 end
- if (ret)
- {
- switch (vk_event)
- {
- case GUI_VKBD_PEN_BAKSPACE:
- mmi_pen_editor_right_soft_key_handler();
- break;
- case GUI_VKBD_PEN_BRACKET:
- mmi_pen_editor_bracket();
- break;
- case GUI_VKBD_PEN_CAPSLOCK:
- mmi_pen_editor_vk_caps_lock();
- break;
- case GUI_VKBD_PEN_CHAR_I:
- mmi_pen_editor_vk_insertcharacter(vk_para);
- break;
- case GUI_VKBD_PEN_DISPLAY_AREA:
- break;
- case GUI_VKBD_PEN_HIDE:
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- mmi_pen_editor_enable_multi_block_handwriting();
- }
- else
- {
- mmi_pen_editor_vk_hide();
- }
- break;
- case GUI_VKBD_PEN_NEWLINE:
- mmi_pen_editor_new_line();
- break;
- case GUI_VKBD_PEN_NONE:
- ret = MMI_FALSE;
- break;
- case GUI_VKBD_PEN_SHOW:
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- mmi_pen_editor_disable_multi_block_handwriting();
- }
- else
- {
- mmi_pen_editor_vk_show();
- }
- break;
- case GUI_VKBD_PEN_SPACE:
- /* Code for ?? */
- mmi_pen_editor_input_character(' ', MMI_FALSE);
- break;
- case GUI_VKBD_PEN_SYMBPICKER:
- mmi_pen_editor_vk_symbol_picker();
- break;
- default:
- MMI_ASSERT(0);
- }
- if (ret)
- {
- return;
- }
- }
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- if (PEN_EDITOR_CANDIDATE_OFF != g_pen_editor_composition_state.candidate_state)
- {
- if (g_pen_editor_composition_state.arrow_enable &&
- PEN_EDITOR_MOVE_OUT != g_pen_editor_composition_state.pen_down_state)
- {
- if (PEN_EDITOR_ARROW_PRESS_DOWN == g_pen_editor_composition_state.right_arrow_state)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x + g_pen_editor_composition_input_box.width + (g_pen_editor_composition_input_box.grid_width >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret)
- {
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_smart_bpmf_pinyin_get_syllable_next();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- //if (PEN_EDITOR_ARROW_DISABLE != g_pen_editor_composition_state.right_arrow_state)
- //{
- // g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- //}
- }
- else if (PEN_EDITOR_ARROW_PRESS_DOWN == g_pen_editor_composition_state.left_arrow_state)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x - (((g_pen_editor_composition_input_box.grid_width << 1) + g_pen_editor_composition_input_box.grid_width) >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret)
- {
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_smart_bpmf_pinyin_get_syllable_prev();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- //if (PEN_EDITOR_ARROW_DISABLE != g_pen_editor_composition_state.left_arrow_state)
- //{
- // g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- //}
- }
- }
- ret = gui_single_line_input_box_translate_pen_event(
- &g_pen_editor_composition_input_box,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- gdi_layer_lock_frame_buffer();
- gui_show_single_line_input_box_ext(&g_pen_editor_composition_input_box, pos.x, pos.y);
- if ((INPUT_MODE_TR_BOPOMO == MMI_current_input_mode ||
- INPUT_MODE_SM_PINYIN == MMI_current_input_mode) &&
- PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == g_pen_editor_composition_state.candidate_state)
- {
- g_pen_editor_composition_index = mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_position();
- mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index(g_pen_editor_composition_index);
- mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable();
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- }
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- if (gPenEditorSelectCandidate)
- {
- if (g_pen_editor_candidate_state.arrow_enable &&
- PEN_EDITOR_MOVE_OUT != g_pen_editor_candidate_state.pen_down_state)
- {
- if (PEN_EDITOR_ARROW_PRESS_DOWN == g_pen_editor_candidate_state.right_arrow_state)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x + gPenEditorCandidateInputBox.width + (gPenEditorCandidateInputBox.grid_width >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret)
- {
- mmi_pen_editor_get_candidates_next_page();
- }
- /* g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP; */
- }
- else if (PEN_EDITOR_ARROW_PRESS_DOWN == g_pen_editor_candidate_state.left_arrow_state)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x - (((gPenEditorCandidateInputBox.grid_width << 1) + gPenEditorCandidateInputBox.grid_width) >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret)
- {
- mmi_pen_editor_get_candidates_prev_page();
- }
- /* g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP; */
- }
- }
- ret = gui_single_line_input_box_translate_pen_event(
- &gPenEditorCandidateInputBox,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret || g_pen_editor_candidate_state.selected_candidate)
- {
- UI_character_type ch, ch1, ch2;
- gdi_layer_lock_frame_buffer();
- /* W05.36 To Fix Candidates Lsit Issue Because of Font Type */
- gPenEditorCandidateInputBox.text_offset_x = 0;
- gui_show_single_line_input_box_ext(&gPenEditorCandidateInputBox, pos.x, pos.y);
- if (!gui_single_line_input_box_test_last_position(&gPenEditorCandidateInputBox))
- {
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- }
- ch1 = *(gPenEditorCandidateInputBox.current_text_p - 2);
- ch2 = *(gPenEditorCandidateInputBox.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- if (PEN_EDITOR_MOVE_OUT == g_pen_editor_candidate_state.pen_down_state)
- {
- ch = g_pen_editor_candidate_state.selected_candidate;
- }
- mmi_pen_editor_input_character(ch, MMI_FALSE);
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_set_RSK();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- mmi_pen_editor_set_right_soft_key_inline_text();
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- set_right_softkey_label(wgui_inline_edit_get_RSK_string());
- set_right_softkey_icon(NULL);
- register_right_softkey_handler();
- set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
- redraw_right_softkey();
- break;
- default:
- break;
- }
- /* Temp Solution for checking Chinese Characters */
- mmi_pen_editor_check_phrase(ch);
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- }
- g_pen_editor_candidate_state.selected_candidate = 0;
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- ret = gui_multitap_input_translate_pen_position(gPenEditorMultitapInput, pos.x, pos.y, &multitap_index);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- if (MMI_FALSE == ret)
- {
- wgui_general_pen_up_hdlr(pos);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_long_tap_handler
- * DESCRIPTION
- * According to the control which pen long tap on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen long tap event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_long_tap_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- S32 multitap_index = 0;
- BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorActiveControl)
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_LONG_TAP,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_LONG_TAP,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_DATE:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_IP4:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_TIME:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- ret = gui_multitap_input_translate_pen_position(gPenEditorMultitapInput, pos.x, pos.y, &multitap_index);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- if (MMI_FALSE == ret)
- {
- wgui_general_pen_long_tap_hdlr(pos);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_repeat_handler
- * DESCRIPTION
- * According to the control which pen repeat on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen repeat event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_repeat_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- BOOL ret = MMI_FALSE;
- S32 multitap_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorActiveControl)
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_REPEAT,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_REPEAT,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- break;
- case PEN_EDITOR_CONTROL_DATE:
- break;
- case PEN_EDITOR_CONTROL_IP4:
- break;
- case PEN_EDITOR_CONTROL_TIME:
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- ret = gui_multitap_input_translate_pen_position(gPenEditorMultitapInput, pos.x, pos.y, &multitap_index);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- if (MMI_FALSE == ret)
- {
- wgui_general_pen_repeat_hdlr(pos);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_abort_handler
- * DESCRIPTION
- * According to the control which pen abort on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen abort event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_abort_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- BOOL ret = MMI_FALSE;
- S32 multitap_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorActiveControl)
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_ABORT,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_ABORT,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- break;
- case PEN_EDITOR_CONTROL_DATE:
- break;
- case PEN_EDITOR_CONTROL_IP4:
- break;
- case PEN_EDITOR_CONTROL_TIME:
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- {
- gui_virtual_keyboard_pen_enum vk_event;
- gui_pen_event_param_struct vk_para;
- ret = gui_virtual_keyboard_translate_pen_event(
- &MMI_virtual_keyboard,
- pos.x,
- pos.y,
- MMI_PEN_EVENT_ABORT,
- &vk_event,
- &vk_para);
- }
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- ret = gui_multitap_input_translate_pen_position(gPenEditorMultitapInput, pos.x, pos.y, &multitap_index);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_NONE;
- if (MMI_FALSE == ret)
- {
- wgui_general_pen_abort_hdlr(pos);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_move_handler
- * DESCRIPTION
- * According to the control which pen move on, do the related action
- * PARAMETERS
- * pos [IN] The position of the pen move event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_move_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_single_line_input_box_pen_enum single_line_input_box_event;
- gui_multi_line_input_box_pen_enum multi_line_input_box_event;
- gui_EMS_input_box_pen_enum EMS_input_box_event;
- S32 multitap_index = 0;
- BOOL ret = MMI_FALSE;
- gui_pen_event_param_struct vk_para;
- gui_virtual_keyboard_pen_enum vk_event;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorActiveControl)
- {
- case PEN_EDITOR_CONTROL_INFORMATION_BAR:
- break;
- case PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX:
- ret = gui_multi_line_input_box_translate_pen_event(
- &MMI_multiline_inputbox,
- MMI_PEN_EVENT_MOVE,
- pos.x,
- pos.y,
- &multi_line_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_EMS_INPUT_BOX:
- ret = gui_EMS_input_box_translate_pen_event(
- &MMI_EMS_inputbox,
- MMI_PEN_EVENT_MOVE,
- pos.x,
- pos.y,
- &EMS_input_box_event);
- break;
- case PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX:
- break;
- case PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX:
- break;
- case PEN_EDITOR_CONTROL_INLINE_TEXT:
- break;
- case PEN_EDITOR_CONTROL_DATE:
- break;
- case PEN_EDITOR_CONTROL_IP4:
- break;
- case PEN_EDITOR_CONTROL_TIME:
- break;
- case PEN_EDITOR_CONTROL_TIME_PERIOD:
- break;
- case PEN_EDITOR_CONTROL_SCROLL_BAR:
- break;
- case PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD:
- ret = gui_virtual_keyboard_translate_pen_event(
- &MMI_virtual_keyboard,
- pos.x,
- pos.y,
- MMI_PEN_EVENT_MOVE,
- &vk_event,
- &vk_para);
- break;
- case PEN_EDITOR_CONTROL_COMPOSITION_AREA:
- if (PEN_EDITOR_CANDIDATE_OFF != g_pen_editor_composition_state.candidate_state)
- {
- if (g_pen_editor_composition_state.arrow_enable)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x - (((g_pen_editor_composition_input_box.grid_width << 1) + g_pen_editor_composition_input_box.grid_width) >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret && g_pen_editor_composition_state.pen_down_state == PEN_EDITOR_IN_LEFT_ARROW)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_LEFT_ARROW;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&g_pen_editor_composition_input_box);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_composition_state.left_arrow_state)
- {
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_composition_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_composition_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- g_pen_editor_composition_input_box.x + g_pen_editor_composition_input_box.width + (g_pen_editor_composition_input_box.grid_width >> 2) - 1,
- g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3),
- g_pen_editor_composition_input_box.grid_width >> 1,
- ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2);
- if (ret && g_pen_editor_composition_state.pen_down_state == PEN_EDITOR_IN_RIGHT_ARROW)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_RIGHT_ARROW;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&g_pen_editor_composition_input_box);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_composition_state.right_arrow_state)
- {
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_composition_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_composition_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- }
- ret = gui_single_line_input_box_translate_pen_event(
- &g_pen_editor_composition_input_box,
- MMI_PEN_EVENT_MOVE,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_IN_CONTROL;
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gui_show_single_line_input_box_ext(&g_pen_editor_composition_input_box, pos.x, pos.y);
- gdi_layer_lock_frame_buffer();
- if ((INPUT_MODE_TR_BOPOMO == MMI_current_input_mode ||
- INPUT_MODE_SM_PINYIN == MMI_current_input_mode) &&
- PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == g_pen_editor_composition_state.candidate_state)
- {
- g_pen_editor_composition_index = mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_position();
- mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index(g_pen_editor_composition_index);
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- if (PEN_EDITOR_OUT_OF_RANGE != g_pen_editor_composition_state.pen_down_state)
- {
- g_pen_editor_composition_state.pen_down_state = PEN_EDITOR_MOVE_OUT;
- }
- if (g_pen_editor_composition_state.right_arrow_state == PEN_EDITOR_ARROW_PRESS_DOWN)
- {
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- if (g_pen_editor_composition_state.left_arrow_state == PEN_EDITOR_ARROW_PRESS_DOWN)
- {
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- }
- break;
- case PEN_EDITOR_CONTROL_CANDIDATE_AREA:
- if (gPenEditorSelectCandidate)
- {
- if (g_pen_editor_candidate_state.arrow_enable)
- {
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x - (((gPenEditorCandidateInputBox.grid_width << 1) + gPenEditorCandidateInputBox.grid_width) >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret && g_pen_editor_candidate_state.pen_down_state == PEN_EDITOR_IN_LEFT_ARROW)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_LEFT_ARROW;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&gPenEditorCandidateInputBox);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_candidate_state.left_arrow_state)
- {
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_candidate_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_candidate_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- ret = PEN_CHECK_BOUND(
- pos.x,
- pos.y,
- gPenEditorCandidateInputBox.x + gPenEditorCandidateInputBox.width + (gPenEditorCandidateInputBox.grid_width >> 2) - 1,
- gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3),
- gPenEditorCandidateInputBox.grid_width >> 1,
- ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2);
- if (ret && g_pen_editor_candidate_state.pen_down_state == PEN_EDITOR_IN_RIGHT_ARROW)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_RIGHT_ARROW;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gui_show_single_line_input_box(&gPenEditorCandidateInputBox);
- if (PEN_EDITOR_ARROW_PRESS_UP == g_pen_editor_candidate_state.right_arrow_state)
- {
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_DOWN;
- }
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_candidate_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_candidate_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- }
- ret = gui_single_line_input_box_translate_pen_event(
- &gPenEditorCandidateInputBox,
- MMI_PEN_EVENT_MOVE,
- pos.x,
- pos.y,
- &single_line_input_box_event);
- if (ret)
- {
- UI_character_type ch, ch1, ch2;
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_IN_CONTROL;
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_CANDIDATE_AREA;
- gui_show_single_line_input_box_ext(&gPenEditorCandidateInputBox, pos.x, pos.y);
- if (!gui_single_line_input_box_test_last_position(&gPenEditorCandidateInputBox))
- {
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- }
- ch1 = *(gPenEditorCandidateInputBox.current_text_p - 2);
- ch2 = *(gPenEditorCandidateInputBox.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- g_pen_editor_candidate_state.selected_candidate = ch;
- gdi_layer_lock_frame_buffer();
- if (mmi_pen_editor_check_input(ch))
- {
- switch (gPenEditorInputBoxType)
- {
- /* W05.32 Fix typo error */
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- multiline_inputbox_multitap_input(ch);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- EMS_inputbox_multitap_input(ch);
- break;
- default:
- break;
- }
- }
- mmi_pen_editor_show_candidate_area(
- g_pen_editor_candidate_state.arrow_enable,
- g_pen_editor_candidate_state.candidate_state);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- if (PEN_EDITOR_OUT_OF_RANGE != g_pen_editor_candidate_state.pen_down_state)
- {
- g_pen_editor_candidate_state.pen_down_state = PEN_EDITOR_MOVE_OUT;
- }
- if (g_pen_editor_candidate_state.right_arrow_state == PEN_EDITOR_ARROW_PRESS_DOWN)
- {
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- if (g_pen_editor_candidate_state.left_arrow_state == PEN_EDITOR_ARROW_PRESS_DOWN)
- {
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- }
- break;
- case PEN_EDITOR_CONTROL_IME_BUTTON:
- break;
- case PEN_EDITOR_CONTROL_MULTITAP:
- ret = gui_multitap_input_translate_pen_position(gPenEditorMultitapInput, pos.x, pos.y, &multitap_index);
- if (ret)
- {
- }
- break;
- case PEN_EDITOR_CONTROL_NONE:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- if (MMI_FALSE == ret)
- {
- wgui_general_pen_move_hdlr(pos);
- }
- }
- #endif /* !defined(__MMI_HANDWRITING_PAD__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_pen_set_stroke_color
- * DESCRIPTION
- * Set the color of the stroke
- * PARAMETERS
- * stroke_color [IN] The desired color of the stroke
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_pen_set_stroke_color(color stroke_color)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorStrokeColor = stroke_color;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_setup_input_box
- * DESCRIPTION
- * Set the related setting for the handwriting componemt
- * PARAMETERS
- * stroke_area [IN] The original stroke area (most exculde the title, virtual keyboard, and soft key)
- * ext_stroke [IN] The stroke area after stroke (most the full screen)
- * input_type [IN] The current input type used to set the virtual keyboard and some functions
- * information_bar_flag [IN] The information bar is enabled or not
- * input_box_type [IN] Which kind of input box is active
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_setup_input_box(
- mmi_pen_handwriting_area_struct *stroke_area,
- mmi_pen_handwriting_area_struct *ext_stroke,
- U16 input_type,
- U8 information_bar_flag,
- mmi_pen_editor_input_box_type_enum input_box_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* int i = 0; */
- int changed_height = 0;
- U16 input_type_only = input_type & INPUT_TYPE_MASK;
- static BOOL is_init = MMI_FALSE;
- int grid_width = 0;
- int font_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_HANDWRITING_MULTI_BLOCK__)
- if (PEN_EDITOR_MULTILINE_INPUT_BOX == input_box_type||
- PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == input_box_type||
- PEN_EDITOR_EMS_INPUT_BOX == input_box_type)
- {
- mmi_pen_editor_set_handwriting_style(PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK);