EditorPen.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:513k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * EditorPen.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for Pen Function in Editor
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /* Include: MMI header file */
- #include "MMI_features.h"
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- #include "EditorPen.h"
- #include "wgui_categories_util.h"
- #include "gui_fixed_menus.h"
- #include "DebugInitDef.h"
- #include "gdi_include.h"
- #include "lcd_sw_rnd.h"
- #include "GlobalDefs.h"
- #include "wgui_softkeys.h"
- #include "PhoneSetupGprots.h"
- #include "ScrMemMgrGprot.h"
- #ifdef UI_SMALL_PIN_EDITOR_SCREEN
- #include "HistoryGprot.h"
- #endif
- /*****************************************************************************
- * Define
- *****************************************************************************/
- // #defined __MMI_HAND_WRITING_GET_STROKES__
- #define WGUI_MAX_SOFTKEY_FUNCTIONS 3
- // #ifdef DEMO_PROJECT
- #define __MMI_HAND_WRITING_EXCLUDE_VK_AREA__
- // #endif
- #ifdef __MMI_MAINLCD_240X320__
- #define PEN_EDITOR_BLOCK_HEIGHT 108
- #else
- #define PEN_EDITOR_BLOCK_HEIGHT 80
- #endif
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /* The candidate is in selection state or not */
- static BOOL gPenEditorSelectCandidate = MMI_FALSE;
- /* Enable Hand Writing or not (needed ?) */
- static BOOL gPenEditorEnableHandWriting = MMI_FALSE;
- /* The state of candidate above virtual keyboard */
- static BOOL gPenEditorVKCandidate = MMI_FALSE;
- /* The buffer to store points of stroke */
- static mmi_pen_point_struct gPenEditorStrokeBuffer[PEN_EDITOR_STROKE_BUFFER_SIZE];
- /* The point used to draw the stroke */
- static mmi_pen_point_struct gPenEditorPreviousPoint;
- /* The color of the stroke */
- static color gPenEditorStrokeColor = {0, 0, 0, 100};
- /* The single line input box for the candidates */
- static single_line_input_box gPenEditorCandidateInputBox;
- /* The text buffer for the candidates */
- static UI_character_type gPenEditorCandidateBuffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- /* Which kind of input box */
- static mmi_pen_editor_input_box_type_enum gPenEditorInputBoxType = PEN_EDITOR_NONE_INPUT_BOX;
- /* To record the type of virtual keyboard for Symbol Keyboard switch (Need to revise) */
- static gui_virtual_keyboard_language_enum gPenEditorPreviousVirtualKeyboardType = GUI_VIRTUAL_KEYBOARD_MAX_LANG;
- /* The State of Virtual Keyboard */
- static mmi_pen_editor_virtual_keyboard_state_enum gPenEditorVKState = PEN_EDITOR_VK_NONE;
- /* Which kind of controls are in the category */
- static mmi_pen_editor_control_set_struct gPenEditorControlSet;
- /* The Active Control to process Pen Event (Activated by Pen Pown) */
- static mmi_pen_editor_control_type_enum gPenEditorActiveControl;
- /* To strore the content of the Virtual Keyboard Text in Display Area */
- static mmi_pen_editor_vk_text_struct gPenEditorVKText;
- /* Pointer to the GDI handler, used by Draw Manager */
- static gdi_handle *gPenEditorGDIHandler = NULL;
- //Layer Buffer for Stroke
- //static U32 gPenEditorStrokeGDIBuffer[(GDI_LCD_WIDTH *
- // GDI_LCD_HEIGHT * (GDI_MAINLCD_BIT_PER_PIXEL>>3) + 3) / 4];
- static U8 *gPenEditorStrokeGDIBuffer = NULL;
- /* Used for Multitap (need to revise) */
- static multitap_input *gPenEditorMultitapInput;
- /* Used for Multitap (need to revise) */
- static BOOL gPenEditorMultitapInputState = MMI_FALSE;
- /* The First Stroke or not */
- static BOOL gPenEditorFirstStroke = MMI_TRUE;
- /* Display th evirtual Keyboard or not */
- static BOOL gPenEditorShowVK = MMI_TRUE;
- /* LSK function from Application */
- static void (*gPenEditorLSKfunction) (void);
- /* The Index NO. of the Selected Candidate */
- static S32 gPenEditorCandidateIndex = 0;
- /* The Page NO. of the candidates (In Chinese Input Method) */
- static S32 gPenEditorCandidatePage = 0;
- /* To Store the text of LSK */
- static UI_string_type gPenEditorLSKText;
- /* To Store Virtual Keyboard Lang. Type in History */
- static gui_virtual_keyboard_language_enum gPenEditorHistoryVirtualKeyboardType = GUI_VIRTUAL_KEYBOARD_MAX_LANG;
- /* The valid characters for INPUT_TYPE_PHONE_NUMBER */
- const UI_character_type gPenEditorPhoneNumberValidCharacters[] =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', 'p', 'w', '#', '*', ' ' };
- /* The valid characters for INPUT_TYPE_KEYPAD_NUMERIC */
- const UI_character_type gPenEditorKeyPadNumbericValidCharacters[] =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*', ' ' };
- /* The valid characters for INPUT_TYPE_EXT_SIM_NUMERIC */
- const UI_character_type gPenEditorPhoneNumberSIMValidCharacters[] =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '#', '*', ' ' };
- /* The valid characters for INPUT_TYPE_DECIMAL_NUMERIC */
- const UI_character_type gPenEditorDecimalNumericValidCharacters[] =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ' ' };
- /* The invalid characters array */
- const UI_character_type gPenEditorPhoneNumberInvalidCharacters[] = { '(', ')', '-', ' ', ' ' };
- const UI_character_type gPenEditorKeyPadNumbericInvalidCharacters[] = { '(', ')', 'p', 'w', '+', '-', ' ', ' ' };
- const UI_character_type gPenEditorPhoneNumberSIMInvalidCharacters[] = { '(', ')', 'p', 'w', '-', ' ', ' ' };
- const UI_character_type gPenEditorUCS2InvalidCharacters[] = {0x20ac, ' ' };
- const UI_character_type gPenEditorEmptyInvalidCharacters[] = { ' ' };
- const gui_virtual_keyboard_pen_enum gPenEditorVKDisableSpace[] = {GUI_VKBD_PEN_SPACE, GUI_VKBD_PEN_NONE};
- const gui_virtual_keyboard_pen_enum gPenEditorVKDisableNewLine[] = {GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_NONE};
- const gui_virtual_keyboard_pen_enum gPenEditorVKDisableNewLineCapsLock[] =
- {GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_CAPSLOCK, GUI_VKBD_PEN_NONE};
- const gui_virtual_keyboard_pen_enum gPenEditorVKDisableEmpty[] = {GUI_VKBD_PEN_NONE};
- const gui_virtual_keyboard_pen_enum gPenEditorVKDisableHideSpace[] =
- {GUI_VKBD_PEN_HIDE, GUI_VKBD_PEN_SPACE, GUI_VKBD_PEN_NONE};
- /* To store the height of list menu for in line editor */
- static S32 gPenEditorListMenuHeight = 0;
- /* The pen speed from PhnsetGetHandwritingSpeed */
- static PHNSET_HANDWRITING_SPEED_ENUM gPenEditorHWSpeed = PHNSET_HANDWRITING_MEDIUM;
- static multiline_inputbox_category_history gPenEditorInlineEditHistory;
- /* Stoke Area for execlude Virtual Keyboard Area */
- static mmi_pen_handwriting_area_struct g_pen_editor_original_handwriting_area;
- const S32 gPenEditorHWSpeedSet[3][2] =
- {
- {750, 2000},
- {1000, 3000},
- {1250, 4000}
- };
- /* The Filler for candidate input box */
- UI_filled_area candidate_inputbox_BG_filler =
- {
- UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_ROUNDED_BORDER | UI_FILLED_AREA_SINGLE_BORDER,
- UI_NULL_IMAGE,
- NULL,
- {192, 240, 248, 100},
- {0, 0, 0, 0},
- {64, 96, 176, 100},
- {255, 0, 0, 100},
- 0
- };
- /* The theme for candidate input box */
- UI_single_line_input_box_theme candidate_singleline_inputbox_theme =
- {
- &candidate_inputbox_BG_filler,
- &candidate_inputbox_BG_filler,
- &candidate_inputbox_BG_filler,
- {0, 0, 0, 100},
- {128, 128, 128, 100},
- {0, 0, 0, 100},
- {255, 255, 255, 100},
- {51, 88, 171, 100},
- {255, 0, 0, 100},
- &MMI_large_font,
- 1,
- UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
- '*'
- };
- /* W06.09 Touch Screen With Keypad V1 */
- multitap_input g_pen_editor_bpmf_pinyin_active_multitap[MAX_MULTITAPS];
- S32 g_pen_editor_active_multitap_index = -1;
- UI_character_type g_pen_editor_bpmf_pinyin_previous_valid_character = 0;
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- /* flag for checking if current VK status is tray when re-entry setup function */
- BOOL gPenEditorHideToTray = MMI_FALSE;
- static MMI_BOOL gPenEditorOnlyRedrawInputBox = MMI_FALSE;
- #endif
- /* W06.11 Do not lock GDI buffer when process wgui_general_pen_up_hdlr */
- BOOL g_pen_editor_hold_confirm = MMI_FALSE;
- BOOL g_pen_editor_vk_show_at_start = MMI_FALSE;
- BOOL g_pen_editor_disable_handwriting = MMI_FALSE;
- BOOL g_pen_editor_disable_virtual_keyboard = MMI_FALSE;
- BOOL g_pen_editor_disable_keypad = MMI_FALSE;
- mmi_pen_editor_key_sequence_struct g_pen_editor_key_sequence;
- U32 g_pen_editor_smart_latin_pre_candidate_length = 0;
- S32 g_pen_editor_smart_latin_candidate_index = 0;
- static single_line_input_box g_pen_editor_composition_input_box;
- static UI_character_type g_pen_editor_composition_buffer[PEN_EDITOR_MAX_COMPOSITION_SIZE];
- static U32 g_pen_editor_composition_index = 0;
- static U32 g_pen_editor_composition_page = 0;
- static UI_character_type g_pen_editor_syllable_table[PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE+1][PEN_EDITOR_MAX_PINYIN_SIZE
- + 1];
- static S32 g_pen_editor_candidate_x;
- static mmi_pen_editor_candidate_state_struct g_pen_editor_candidate_state;
- static mmi_pen_editor_candidate_state_struct g_pen_editor_composition_state;
- static mmi_pen_editor_vk_keys_set_struct g_pen_editor_vk_keys_set;
- static UI_character_type g_pen_editor_vk_characters_disable_list[PEN_EDITOR_VK_MAX_DISABLE_KEYS + 1];
- static gui_virtual_keyboard_pen_enum g_pen_editor_vk_event_keys_disable_list[PEN_EDITOR_VK_MAX_DISABLE_KEYS + 1];
- static mmi_pen_editor_handwriting_style_enum g_pen_editor_handwriting_style;
- static S32 g_pen_editor_active_block = 0;
- static mmi_pen_handwriting_area_struct g_multi_block_stroke_area[2];
- static MMI_BOOL g_pen_editor_resized_by_vk = MMI_FALSE;
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- void mmi_pen_editor_enable_multi_block_handwriting(void);
- void mmi_pen_editor_disable_multi_block_handwriting(void);
- void mmi_pen_editor_handwriting_direct_input(void);
- void mmi_pen_editor_multi_block_stroke_down_handler(mmi_pen_point_struct pos);
- void mmi_pen_editor_multi_block_stroke_move_handler(mmi_pen_point_struct pos);
- void mmi_pen_editor_multi_block_stroke_up_handler(mmi_pen_point_struct pos);
- S32 mmi_pen_editor_handwriting_check_block(mmi_pen_point_struct pos);
- void mmi_pen_editor_draw_handwriting_block(void);
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- extern UI_EMS_input_box MMI_EMS_inputbox;
- extern multi_line_input_box MMI_multiline_inputbox;
- extern UI_theme *current_UI_theme;
- extern UI_multitap_input_theme *current_multitap_input_theme;
- extern IP4_input *current_IP4_input;
- extern date_input *current_date_input;
- extern single_line_input_box MMI_inline_singleline_inputbox;
- extern time_period_input *current_time_period_input;
- extern time_input *current_time_input;
- extern S32 UI_device_width;
- extern S32 wgui_EMS_inputbox_information_bar_x;
- extern S32 wgui_EMS_inputbox_information_bar_y;
- extern S32 wgui_EMS_inputbox_information_bar_width;
- extern S32 wgui_EMS_inputbox_information_bar_height;
- extern S16 MMI_current_input_type;
- extern fixed_list_menu MMI_fixed_list_menu;
- extern S32(*cat200_search_function) (U8 *);
- extern S32 wgui_inline_item_highlighted_index;
- extern S32 UI_cursor_x1;
- extern S32 UI_cursor_y1;
- extern void handle_category28_change_input_mode(void);
- extern void (*EMS_inputbox_input_callback) (void);
- extern void (*multiline_inputbox_input_callback) (void);
- extern void (*singleline_inputbox_input_callback) (void);
- extern void (*inline_singleline_inputbox_input_callback) (void);
- extern U8 wgui_inline_singleline_inputbox_decimal_input_mode_flag;
- extern U8 wgui_multiline_inputbox_decimal_input_mode_flag;
- extern U8 wgui_singleline_inputbox_decimal_input_mode_flag;
- extern U8 wgui_inline_item_handled;
- extern void (*complete_inline_item_edit) (void);
- extern U8 wgui_inputbox_RSK_label_clear;
- extern U8 category28_RSK_label_clear;
- extern U8 wgui_singleline_inputbox_RSK_label_clear;
- extern icontext_button MMI_softkeys[];
- extern void (*wgui_inline_edit_DONE_function) (void);
- extern void (*softkey_functions[WGUI_MAX_SOFTKEYS][WGUI_MAX_SOFTKEY_FUNCTIONS]) (void);
- extern S16 MMI_current_input_ext_type;
- extern U8 numeric_leading_zero;
- extern void register_inline_text_edit_handle_right_softkey_up(void);
- extern UI_string_type inline_text_edit_RSK_label_string;
- extern PU8 inline_text_edit_RSK_label_icon;
- extern U8 wgui_inline_list_menu_changed;
- extern U8 wgui_inline_list_menu_disable_done;
- extern void handle_inline_text_edit_right_softkey_long_press(void);
- extern void wgui_inline_text_edit_set_RSK_BACK_function(void);
- extern UI_string_type wgui_inline_edit_get_RSK_string(void);
- extern void handle_inline_text_edit_right_softkey_down(void);
- extern void (*redraw_current_inline_item) (void);
- extern void register_EMS_inputbox_keys(void);
- extern void wgui_set_EMS_inputbox_RSK(void);
- extern void wgui_set_RSK(void);
- extern void inline_edit_singleline_inputbox_multitap_input_complete(void);
- extern void EMS_inputbox_multitap_input_complete(void);
- extern void set_leading_zero(U8 u8type);
- extern void gui_multi_line_input_box_set_pen_scroll_delay(multi_line_input_box *b, S32 delay_time);
- extern void gui_EMS_input_box_set_pen_scroll_delay(UI_EMS_input_box *b, S32 delay_time);
- extern void EMS_inputbox_multitap_input(UI_character_type c);
- extern void redraw_EMS_inputbox(void);
- extern void show_inline_singleline_inputbox(void);
- extern void date_input_move_to_x_y(date_input *d, S32 x, S32 y);
- extern void IP4_input_move_to_x_y(IP4_input *ip4, S32 x, S32 y);
- extern void time_input_move_to_x_y(time_input *t, S32 x, S32 y);
- extern void time_period_input_move_to_x_y(time_period_input *tp, S32 x, S32 y);
- extern void wgui_multiline_inputbox_decimal_numeric_handle_pound_key_down(void);
- extern void EMS_inputbox_direct_input(UI_character_type c);
- extern void refresh_search_list(U8 *name);
- extern void wgui_singleline_inputbox_decimal_numeric_handle_pound_key_down(void);
- extern void inline_edit_singleline_inputbox_multitap_input(UI_character_type c);
- extern void wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down(void);
- extern void inline_edit_singleline_inputbox_direct_input(UI_character_type c);
- extern void date_input_direct_input_nodraw(UI_character_type c);
- extern S32 date_input_test_last_position(date_input *d);
- extern void IP4_input_direct_input_nodraw(UI_character_type c);
- extern S32 IP4_input_test_last_position(IP4_input *ip4);
- extern void time_input_direct_input_nodraw(UI_character_type c);
- extern S32 time_input_test_last_position(time_input *t);
- extern void time_period_input_direct_input_nodraw(UI_character_type c);
- extern S32 time_period_input_test_last_position(time_period_input *tp);
- extern void wgui_handle_inputbox_right_softkey_down(void);
- extern void EMS_inputbox_backspace(void);
- extern void wgui_handle_singleline_inputbox_right_softkey_down(void);
- extern void inline_edit_singleline_inputbox_delete_character(void);
- extern int gui_multi_line_input_box_get_remaining_length(multi_line_input_box *b);
- extern void EMS_inputbox_previous(void);
- extern int gui_single_line_input_box_get_remaining_length(single_line_input_box *b);
- extern void inline_edit_singleline_inputbox_previous_character(void);
- extern void redraw_inline_singleline_inputbox(void);
- extern void EMS_inputbox_insert_new_line(void);
- extern S32 mmi_ime_get_candidates_by_composition(UI_character_type *composition, UI_character_type *candidatebuffer);
- extern S32 mmi_ime_get_candidates_by_phrase(UI_character_type phrase, UI_character_type *candidatebuffer);
- extern S32 mmi_ime_get_candidates_by_page(S32 page, UI_character_type *candidatebuffer);
- extern S32 mmi_ime_smart_latin_get_candidates_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *candidatebuffer);
- extern S32 mmi_ime_smart_latin_get_candidates_by_index(S32 *index, UI_character_type *candidatebuffer);
- extern S32 mmi_ime_smart_bpmf_pinyin_get_syllable_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *syllable_buffer,
- S32 start_index,
- S32 end_index);
- extern S32 mmi_ime_chinese_stroke_get_candidates_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *candidatebuffer,
- UI_character_type *strokebuffer);
- extern void wgui_set_singleline_RSK(void);
- extern void handle_category28_input(void);
- extern void wgui_handle_inputbox_input(void);
- extern void wgui_handle_qsearch_singleline_inputbox_change_input_mode(void);
- extern void cat200_virtual_keypad_callback(void);
- extern void RedrawCategoryControlledArea200Screen(dm_coordinates *coordinate);
- extern void wgui_redraw_input_information_bar(void);
- extern void change_EMS_inputbox_mode(U8 mode);
- extern void wgui_EMS_redraw_input_information_bar(void);
- extern void wgui_inline_edit_default_list_highlight_handler(S32 item_index);
- extern void wgui_handle_singleline_inputbox_change_input_mode(void);
- extern void wgui_handle_inline_singleline_inputbox_change_input_mode(void);
- extern MMI_BOOL get_multitap_state(void);
- extern void inline_edit_change_singleline_inputbox_mode(U8 mode);
- extern U8 *wgui_inline_edit_get_current_item_history(U8 *history_buffer);
- /* W06.09 Touch Screen With Keypad V1 */
- extern FuncPtr currKeyFuncPtrs[MAX_KEYS][MAX_KEY_TYPE];
- extern UI_character_type *get_bpmf_multitap_string(S32 i);
- extern const UI_character_type numberless_lowercase_multitap_strings[MAX_MULTITAPS][32];
- extern void handle_inline_text_edit_right_softkey_up(void);
- extern void cat201_register_key_func(void);
- extern void RedrawCategoryControlledArea201Screen(void);
- extern S32 handwriting_stroke_layer_mem;
- extern S32 gui_EMS_input_box_highlight_cursor_number(UI_EMS_input_box *b, S32 numOfChar);
- extern void gui_single_line_input_box_locate_cursor(single_line_input_box *b);
- extern void draw_resizeable_arrow(S32 x, S32 y, U8 arrow_type, color c, S32 width, S32 height);
- extern S32 UI_get_font_height(UI_font_type f);
- extern void wgui_EMS_set_text_format(EMSTextFormat text_format);
- extern S32 wgui_information_bar_input_mode_display_width;
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- extern void mmi_pen_editor_hand_writing_initailize(void);
- extern S32 mmi_pen_editor_hand_writing_get_candidates(
- U16 *stroke_buffer,
- UI_character_type *candidate_array,
- mmi_pen_editor_input_type_enum h_w_type,
- S32 number);
- #if !defined(__MMI_T9__) && !defined(__MMI_ZI__) && !defined(__MMI_CSTAR__) //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_get_candidates_by_phrase
- * DESCRIPTION
- * Get the Chinese candidates as phrase
- * PARAMETERS
- * phrase [IN] The last character of the phrase
- * candidatebuffer [OUT] Buffer to ctore candidates
- * RETURNS
- * Number of the Candidates
- *****************************************************************************/
- S32 mmi_ime_get_candidates_by_phrase(UI_character_type phrase, UI_character_type *candidatebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_get_candidates_by_composition
- * DESCRIPTION
- * Get the Chinese candidates from BPMF/PinYin composition
- * PARAMETERS
- * composition [IN] The BPMF/PinYin composition
- * candidatebuffer [OUT] Buffer to store candidates
- * RETURNS
- * Number of the Candidates
- *****************************************************************************/
- S32 mmi_ime_get_candidates_by_composition(UI_character_type *composition, UI_character_type *candidatebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_get_candidates_by_page
- * DESCRIPTION
- * Get the candidates according to the page index
- * PARAMETERS
- * page [IN] The page index
- * candidatebuffer [OUT] Buffer to store candidates
- * RETURNS
- * Number of the candidates
- *****************************************************************************/
- S32 mmi_ime_get_candidates_by_page(S32 page, UI_character_type *candidatebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_smart_latin_get_candidates_by_key_sequence
- * DESCRIPTION
- * Get the latin candidate by key sequence
- * PARAMETERS
- * key_sequence [IN] The key sequence
- * key_sequence_length [IN] The length of the key sequence
- * candidatebuffer [OUT] Buffer to store candidates
- * RETURNS
- * The length of the candidate
- *****************************************************************************/
- S32 mmi_ime_smart_latin_get_candidates_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *candidatebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_smart_latin_get_candidates_by_index
- * DESCRIPTION
- * Get the candidate according to the index
- * PARAMETERS
- * index [IN/OUT] The index of the candidate
- * candidatebuffer [OUT] Buffer to store candidates
- * RETURNS
- * The length of the candidate
- *****************************************************************************/
- S32 mmi_ime_smart_latin_get_candidates_by_index(S32 *index, UI_character_type *candidatebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_chinese_stroke_get_candidates_by_key_sequence
- * DESCRIPTION
- * Get the candidates and strokes from the stroke key sequence
- * PARAMETERS
- * key_sequence [IN] The stroke key sequence
- * key_sequence_length [IN] The length of the stroke key sequence
- * candidatebuffer [OUT] Buffer to store candidates
- * strokebuffer [OUT] Buffer to store stroke sequence
- * RETURNS
- * Number of the candidates
- *****************************************************************************/
- S32 mmi_ime_chinese_stroke_get_candidates_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *candidatebuffer,
- UI_character_type *strokebuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ime_smart_bpmf_pinyin_get_syllable_by_key_sequence
- * DESCRIPTION
- * Get the syllables from the key sequence
- * PARAMETERS
- * key_sequence [IN] The key sequence
- * key_sequence_length [IN] The length of the key sequence
- * syllable_buffer [OUT] Buffer to store syllables
- * start_index [IN] The first index of the syllables
- * end_index [IN] The last index of the syllables
- * RETURNS
- * Number of the syllables
- *****************************************************************************/
- S32 mmi_ime_smart_bpmf_pinyin_get_syllable_by_key_sequence(
- mmi_keypads_enum *key_sequence,
- S32 key_sequence_length,
- UI_character_type *syllable_buffer,
- S32 start_index,
- S32 end_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- #endif /* !defined(__MMI_T9__) && !defined(__MMI_ZI__) */
- #if !defined(__MMI_HANWANG__) && !defined(__MMI_PENPOWER__)
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hand_writing_initailize
- * DESCRIPTION
- * Initialize handwriting module
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_hand_writing_initailize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hand_writing_get_candidates
- * DESCRIPTION
- * Get the candidates from the handwriting strokes
- * PARAMETERS
- * stroke_buffer [IN] Stokes data passed to handwriting module
- * candidate_array [OUT] Buffer to store candidates
- * h_w_type [IN] Which kind of candidates to return, Chinese, English, Symbol (need to revise)
- * number [IN] The wished number of candidate
- * RETURNS
- * The number of the candidates
- *****************************************************************************/
- S32 mmi_pen_editor_hand_writing_get_candidates(
- U16 *stroke_buffer,
- UI_character_type *candidate_array,
- mmi_pen_editor_input_type_enum h_w_type,
- S32 number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- #endif /* !defined(__MMI_HANWANG__) && !defined(__MMI_PENPOWER__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_compute_candidate_input_box_height
- * DESCRIPTION
- * To compute the height of the candidate input box
- * PARAMETERS
- * void
- * RETURNS
- * The height of the candidate input box
- *****************************************************************************/
- S32 mmi_pen_editor_compute_candidate_input_box_height(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- height = UI_get_font_height(candidate_singleline_inputbox_theme.text_font) + 2;
- if (height < MMI_multitap_height)
- {
- height = MMI_multitap_height;
- }
- return height;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_change_handwriting_area
- * DESCRIPTION
- * Change the handwriting area according the virtual keyboard, composition box, and candidate box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_change_handwriting_area(void)
- {
- #ifdef __MMI_HAND_WRITING_EXCLUDE_VK_AREA__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!(PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style()))
- {
- if (gPenEditorEnableHandWriting)
- {
- mmi_pen_handwriting_area_struct ext_stroke;
- ext_stroke.x1 = 0;
- ext_stroke.y1 = 0;
- ext_stroke.x2 = UI_device_width - 1;
- ext_stroke.y2 = UI_device_height - 1;
- g_pen_editor_original_handwriting_area.y2 = MMI_virtual_keyboard.y;
- if (gPenEditorSelectCandidate || gPenEditorVKCandidate)
- {
- g_pen_editor_original_handwriting_area.y2 = gPenEditorCandidateInputBox.y;
- }
- if (PEN_EDITOR_CANDIDATE_OFF != g_pen_editor_composition_state.candidate_state)
- {
- g_pen_editor_original_handwriting_area.y2 = g_pen_editor_composition_input_box.y;
- }
- mmi_pen_change_handwriting_area(1, &g_pen_editor_original_handwriting_area, &ext_stroke);
- }
- }
- #endif /* __MMI_HAND_WRITING_EXCLUDE_VK_AREA__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_left_soft_key
- * DESCRIPTION
- * Change Left Soft Key text according to previous
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_set_left_soft_key(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_left_softkey_label(gPenEditorLSKText);
- set_left_softkey_icon(NULL);
- redraw_left_softkey();
- register_left_softkey_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_left_soft_key_select
- * DESCRIPTION
- * Change Left Soft Key text to STR_GLOBAL_SELECT for selecting candidate purpose
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_set_left_soft_key_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_left_softkey_label((UI_string_type) get_string(STR_GLOBAL_SELECT));
- set_left_softkey_icon(NULL);
- redraw_left_softkey();
- register_left_softkey_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_right_soft_key_inline_text
- * DESCRIPTION
- * Set Right Soft Key for in-line text control according its status
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_set_right_soft_key_inline_text(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gui_single_line_input_box_get_text_length(&MMI_inline_singleline_inputbox) > 0)
- {
- set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
- set_right_softkey_icon(NULL);
- register_right_softkey_handler();
- redraw_right_softkey();
- set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- set_right_softkey_function(handle_inline_text_edit_right_softkey_down, KEY_EVENT_DOWN);
- set_right_softkey_function(handle_inline_text_edit_right_softkey_long_press, KEY_EVENT_LONG_PRESS);
- }
- else
- {
- if (wgui_inline_list_menu_changed)
- {
- wgui_inline_text_edit_set_RSK_BACK_function();
- /* W06.11 Set RSK as handle_inline_text_edit_right_softkey_up when buffer is empty */
- set_right_softkey_function(handle_inline_text_edit_right_softkey_up, KEY_EVENT_UP);
- }
- else
- {
- set_right_softkey_label(inline_text_edit_RSK_label_string);
- set_right_softkey_icon(inline_text_edit_RSK_label_icon);
- register_right_softkey_handler();
- redraw_right_softkey();
- set_right_softkey_function(register_inline_text_edit_handle_right_softkey_up, KEY_EVENT_UP);
- set_right_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_right_softkey
- * DESCRIPTION
- * Set Right Soft Key according to the state
- * PARAMETERS
- * rsk_type [IN] PEN_EDITOR_RSK_BY_STATE : The candidate box is on and set RSK to CLEAR if the candidate is in input control
- * PEN_EDITOR_RSK_BACK : Set RSK to STR_GLOBAL_BACK
- * PEN_EDITOR_RSK_CLEAR : Set RSK to STR_GLOBAL_CLEAR
- *
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_set_right_softkey(mmi_pen_editor_rsk_type_enum rsk_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (rsk_type)
- {
- case PEN_EDITOR_RSK_BY_STATE:
- if (get_multitap_state())
- {
- set_right_softkey_label((UI_string_type) get_string(STR_GLOBAL_CLEAR));
- }
- else
- {
- set_right_softkey_label((UI_string_type) get_string(STR_GLOBAL_BACK));
- }
- break;
- case PEN_EDITOR_RSK_BACK:
- set_right_softkey_label((UI_string_type) get_string(STR_GLOBAL_BACK));
- break;
- case PEN_EDITOR_RSK_CLEAR:
- set_right_softkey_label((UI_string_type) get_string(STR_GLOBAL_CLEAR));
- break;
- default:
- MMI_DBG_ASSERT(0);
- }
- set_right_softkey_icon(NULL);
- redraw_right_softkey();
- register_right_softkey_handler();
- /* W06.10 Fix Right Soft Key Issue */
- set_right_softkey_function(mmi_pen_editor_right_soft_key_handler, KEY_EVENT_UP);
- set_right_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- set_right_softkey_function(UI_dummy_function, KEY_LONG_PRESS);
- }
- #if defined(__MMI_HAND_WRITING_GET_STROKES__)
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_save_stroke_to_file
- * DESCRIPTION
- * Save the stroke data to the file
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_pen_editor_save_stroke_to_file(void)
- {
- #if defined(MMI_ON_HARDWARE_P)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- {
- FS_HANDLE stroke_out;
- U32 write_len;
- int i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stroke_out = FS_Open(L"Stroke_Out.str", FS_CREATE | FS_READ_WRITE);
- if (stroke_out <= 0)
- {
- MMI_ASSERT(0);
- }
- FS_Seek(stroke_out, 0, FS_FILE_END);
- for (i = 0; i < PEN_EDITOR_STROKE_BUFFER_SIZE; i++)
- {
- FS_Write(stroke_out, &(gPenEditorStrokeBuffer[i].x), sizeof(S16), (U32*) & write_len);
- FS_Write(stroke_out, &(gPenEditorStrokeBuffer[i].y), sizeof(S16), (U32*) & write_len);
- #if defined(__MMI_HANWANG__)
- if ((-1) == gPenEditorStrokeBuffer[i].x && (-1) == gPenEditorStrokeBuffer[i].y)
- {
- break;
- }
- #elif defined(__MMI_PENPOWER__)
- if ((-1) == gPenEditorStrokeBuffer[i].x && (0) == gPenEditorStrokeBuffer[i].y)
- {
- break;
- }
- #else
- if ((-1) == gPenEditorStrokeBuffer[i].x && (-1) == gPenEditorStrokeBuffer[i].y)
- {
- break;
- }
- #endif
- }
- FS_Close(stroke_out);
- }
- #else /* defined(MMI_ON_HARDWARE_P) */
- {
- FILE *stroke_out;
- int i = 0;
- if ((stroke_out = fopen("Stroke_Out.str", "a+")) == NULL)
- {
- fprintf(stderr, "Cannot open output file.n");
- }
- fseek(stroke_out, 0, SEEK_END);
- for (i = 0; i < PEN_EDITOR_STROKE_BUFFER_SIZE; i++)
- {
- fwrite(&(gPenEditorStrokeBuffer[i].x), sizeof(S16), 1, stroke_out);
- fwrite(&(gPenEditorStrokeBuffer[i].y), sizeof(S16), 1, stroke_out);
- if ((-1) == gPenEditorStrokeBuffer[i].x && (-1) == gPenEditorStrokeBuffer[i].y)
- {
- break;
- }
- }
- fclose(stroke_out);
- }
- #endif /* defined(MMI_ON_HARDWARE_P) */
- }
- #endif /* defined(__MMI_HAND_WRITING_GET_STROKES__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_disable_input
- * DESCRIPTION
- * To Disable the way to input characters at the beginning
- * PARAMETERS
- * disable_input_flag [IN] PEN_EDITOR_DISABLE_HANDWRITNG : Disable Handwriting
- * PEN_EDITOR_DISABLE_VIRTUAL_KEYBOARD : Disable Virtual Keyboard
- * PEN_EDITOR_DISABLE_KEYPAD : Not Implemented
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_disable_input(U32 disable_input_flag)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (disable_input_flag & PEN_EDITOR_DISABLE_HANDWRITNG)
- {
- g_pen_editor_disable_handwriting = MMI_TRUE;
- }
- if (disable_input_flag & PEN_EDITOR_DISABLE_VIRTUAL_KEYBOARD)
- {
- g_pen_editor_disable_virtual_keyboard = MMI_TRUE;
- }
- if (disable_input_flag & PEN_EDITOR_DISABLE_KEYPAD)
- {
- g_pen_editor_disable_keypad = MMI_TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_check_phrase
- * DESCRIPTION
- * Check the character is able to be phrase-completed or not. If yes, do the related action
- * PARAMETERS
- * ch [IN] The character to be checked
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_check_phrase(UI_character_type ch)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ch >= 0x4e00 && ch <= 0x9fff)
- {
- /* W05.35 Temp Solution for Candidate Index Issue */
- mmi_pen_editor_reset_candidate_index();
- if (g_pen_editor_composition_state.candidate_state != PEN_EDITOR_CANDIDATE_OFF)
- {
- int change_height = g_pen_editor_composition_input_box.height;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- mmi_pen_editor_resize_content_area(change_height);
- mmi_pen_editor_reset_key_sequence(&g_pen_editor_key_sequence);
- }
- if (mmi_pen_editor_get_candidates_by_phrase(ch))
- {
- gPenEditorSelectCandidate = MMI_TRUE;
- /* Temp Solution for LSK Text Update */
- //W05.35 For LSK Text Issue
- //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_register_arrow_keys();
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- }
- }
- else
- {
- if (gPenEditorCandidateInputBox.y >= (PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM))
- {
- gPenEditorVKState = PEN_EDITOR_VK_OFF;
- }
- }
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BY_STATE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hide_candidate_area
- * DESCRIPTION
- * Clear the area of the candidate box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_hide_candidate_area(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- gui_reset_clip();
- gdi_layer_lock_frame_buffer();
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- gPenEditorCandidateInputBox.y - 1,
- UI_device_width,
- gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- gPenEditorCandidateInputBox.y - 1,
- UI_device_width,
- gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1,
- c);
- }
- gdi_layer_unlock_frame_buffer();
- gui_BLT_double_buffer(
- 0,
- gPenEditorCandidateInputBox.y,
- UI_device_width - 1,
- gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1);
- } /* end of mmi_pen_editor_hide_candidate_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_draw_arrow
- * DESCRIPTION
- * Darw the arrows for the composition box or the candidate box
- * PARAMETERS
- * arrow_direction [IN] The direction of the arrow. Now we only support PEN_EDITOR_ARROW_DIRECTION_RIGHT and PEN_EDITOR_ARROW_DIRECTION_LEFT
- * arrow_state [IN] The state of the arrow. PEN_EDITOR_ARROW_DISABLE, PEN_EDITOR_ARROW_PRESS_DOWN, and PEN_EDITOR_ARROW_PRESS_UP
- * arrow_type [IN] The arrow is for the composition box and the candidate box. PEN_EDITOR_ARROW_FOR_CANDIDATE and PEN_EDITOR_ARROW_FOR_COMPOSITION
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_draw_arrow(
- mmi_pen_editor_arrow_direction_enum arrow_direction,
- mmi_pen_editor_arrow_state_enum arrow_state,
- mmi_pen_editor_arrow_type_enum arrow_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color arrow_color;
- S32 x = 0, y = 0, width = 0, height = 0;
- S32 input_box_x = 0, input_box_width = 0, input_box_grid_width = 0;
- U8 direction = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_ARROW_FOR_CANDIDATE == arrow_type)
- {
- input_box_x = gPenEditorCandidateInputBox.x;
- input_box_width = gPenEditorCandidateInputBox.width;
- input_box_grid_width = gPenEditorCandidateInputBox.grid_width;
- y = gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3) + 1;
- width = gPenEditorCandidateInputBox.grid_width >> 1;
- height = ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2;
- }
- else if (PEN_EDITOR_ARROW_FOR_COMPOSITION == arrow_type)
- {
- input_box_x = g_pen_editor_composition_input_box.x;
- input_box_width = g_pen_editor_composition_input_box.width;
- input_box_grid_width = g_pen_editor_composition_input_box.grid_width;
- y = g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3) + 1;
- width = g_pen_editor_composition_input_box.grid_width >> 1;
- height = ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2;
- }
- if (PEN_EDITOR_ARROW_DISABLE == arrow_state)
- {
- arrow_color = gui_color(200, 200, 200);
- }
- else
- {
- arrow_color = gui_color(0, 102, 204);
- }
- if (PEN_EDITOR_ARROW_DIRECTION_RIGHT == arrow_direction)
- {
- x = input_box_x + input_box_width + (input_box_grid_width >> 2);
- direction = 1;
- if (PEN_EDITOR_ARROW_DISABLE == arrow_state || PEN_EDITOR_ARROW_PRESS_UP == arrow_state)
- {
- }
- else if (PEN_EDITOR_ARROW_PRESS_DOWN == arrow_state)
- {
- x++;
- y++;
- }
- }
- else if (PEN_EDITOR_ARROW_DIRECTION_LEFT == arrow_direction)
- {
- x = input_box_x - (((input_box_grid_width << 1) + input_box_grid_width) >> 2) - 2;
- direction = 0;
- if (PEN_EDITOR_ARROW_DISABLE == arrow_state || PEN_EDITOR_ARROW_PRESS_UP == arrow_state)
- {
- }
- else if (PEN_EDITOR_ARROW_PRESS_DOWN == arrow_state)
- {
- x--;
- y++;
- }
- }
- draw_resizeable_arrow(x, y, direction, arrow_color, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_candidate_is_able_to_next_page
- * DESCRIPTION
- * Is it able to jump to the next page in the candidate box
- * PARAMETERS
- * void
- * RETURNS
- * MMI_TRUE : yes
- * MMI_FALSE : no
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_candidate_is_able_to_next_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- int num = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorCandidatePage++;
- num = mmi_ime_get_candidates_by_page(gPenEditorCandidatePage, candidate_buffer);
- if (!num)
- {
- gPenEditorCandidatePage--;
- return MMI_FALSE;
- }
- else
- {
- gPenEditorCandidatePage--;
- return MMI_TRUE;
- }
- } /* end of mmi_pen_editor_candidate_is_able_to_next_page */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_candidate_is_able_to_prev_page
- * DESCRIPTION
- * Is it able to jump to the previous page in the candidate box
- * PARAMETERS
- * void
- * RETURNS
- * MMI_TRUE : yes
- * MMI_FALSE : no
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_candidate_is_able_to_prev_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorCandidatePage)
- {
- return MMI_TRUE;
- }
- return MMI_FALSE;
- } /* end of mmi_pen_editor_candidate_is_able_to_prev_page */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_composition_is_able_to_next
- * DESCRIPTION
- * Is it able to jump to the next syllable in the composition box
- * PARAMETERS
- * void
- * RETURNS
- * MMI_TRUE : yes
- * MMI_FALSE : no
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_composition_is_able_to_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((g_pen_editor_composition_index < PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1) &&
- g_pen_editor_syllable_table[g_pen_editor_composition_index + 1][0] != ' ')
- {
- return MMI_TRUE;
- }
- else if (g_pen_editor_composition_index == PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1)
- {
- S32 num = 0;
- g_pen_editor_composition_index = 0;
- g_pen_editor_composition_page++;
- num = mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE);
- g_pen_editor_composition_index = PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
- g_pen_editor_composition_page--;
- mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE);
- if (num)
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- else
- {
- return MMI_FALSE;
- }
- } /* end of mmi_pen_editor_composition_is_able_to_next */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_composition_is_able_to_prev
- * DESCRIPTION
- * Is it able to jump to the previous syllable in the composition box
- * PARAMETERS
- * void
- * RETURNS
- * MMI_TRUE : yes
- * MMI_FALSE : no
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_composition_is_able_to_prev(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_composition_index || g_pen_editor_composition_page)
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- } /* end of mmi_pen_editor_composition_is_able_to_prev */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_show_candidate_area
- * DESCRIPTION
- * Draw the candidate box according to its state
- * PARAMETERS
- * arrow_enable [IN] Draw the arrows or not. MMI_TRUE : yes MMI_FALSE : no
- * candiate_state [IN] PEN_EDITOR_CANDIDATE_ON_AND_FOCUS : Focus on the candidate box
- * PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS : Not focus on the candidate box
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_show_candidate_area(MMI_BOOL arrow_enable, mmi_pen_editor_candidate_state_enum candiate_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_editor_hide_candidate_area();
- if (PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == candiate_state)
- {
- gPenEditorCandidateInputBox.flags &= ~UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- }
- else if (PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS == candiate_state)
- {
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- }
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP;
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_CHARACTER_HIGHLIGHT;
- if (!arrow_enable)
- {
- gui_resize_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.grid_width * PEN_EDITOR_CANDIDATE_SIZE,
- gPenEditorCandidateInputBox.height);
- gui_move_single_line_input_box(&gPenEditorCandidateInputBox, MMI_multitap_x, gPenEditorCandidateInputBox.y);
- g_pen_editor_candidate_state.arrow_enable = MMI_FALSE;
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- }
- else
- {
- g_pen_editor_candidate_state.arrow_enable = MMI_TRUE;
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- if (mmi_pen_editor_candidate_is_able_to_next_page() &&
- !(UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW & gPenEditorCandidateInputBox.flags))
- {
- g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- if (mmi_pen_editor_candidate_is_able_to_prev_page() &&
- !(UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW & gPenEditorCandidateInputBox.flags))
- {
- g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- gui_resize_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.grid_width * PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS,
- gPenEditorCandidateInputBox.height);
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- MMI_multitap_x + gPenEditorCandidateInputBox.grid_width,
- gPenEditorCandidateInputBox.y);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_candidate_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_candidate_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_CANDIDATE);
- }
- gui_show_single_line_input_box(&gPenEditorCandidateInputBox);
- } /* end of mmi_pen_editor_show_candidate_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hide_composition_area
- * DESCRIPTION
- * Clear the area of the composition box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_hide_composition_area(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- gui_reset_clip();
- gdi_layer_lock_frame_buffer();
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- g_pen_editor_composition_input_box.y,
- UI_device_width,
- g_pen_editor_composition_input_box.y + g_pen_editor_composition_input_box.height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- g_pen_editor_composition_input_box.y,
- UI_device_width,
- g_pen_editor_composition_input_box.y + g_pen_editor_composition_input_box.height - 1,
- c);
- }
- gdi_layer_unlock_frame_buffer();
- gui_BLT_double_buffer(
- 0,
- g_pen_editor_composition_input_box.y,
- UI_device_width - 1,
- g_pen_editor_composition_input_box.y + g_pen_editor_composition_input_box.height - 1);
- } /* end of mmi_pen_editor_hide_composition_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_show_composition_area
- * DESCRIPTION
- * Draw the composition box according to its state
- * PARAMETERS
- * arrow_enable [IN] Draw the arrows or not. MMI_TRUE : yes MMI_FALSE : no
- * candiate_state [IN] PEN_EDITOR_CANDIDATE_ON_AND_FOCUS : Focus on the composition box
- * PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS : Not focus on the composition box
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_show_composition_area(MMI_BOOL arrow_enable, mmi_pen_editor_candidate_state_enum candiate_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_editor_hide_composition_area();
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP;
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_CHARACTER_HIGHLIGHT;
- if (PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == candiate_state)
- {
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
- }
- else if (PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS == candiate_state)
- {
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- g_pen_editor_composition_input_box.flags &= ~UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP;
- g_pen_editor_composition_input_box.flags &= ~UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
- g_pen_editor_composition_input_box.flags &= ~UI_SINGLE_LINE_INPUT_BOX_CHARACTER_HIGHLIGHT;
- g_pen_editor_composition_input_box.flags &= ~UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- }
- if (!arrow_enable)
- {
- gui_resize_single_line_input_box(
- &g_pen_editor_composition_input_box,
- g_pen_editor_composition_input_box.grid_width * PEN_EDITOR_CANDIDATE_SIZE,
- g_pen_editor_composition_input_box.height);
- gui_move_single_line_input_box(
- &g_pen_editor_composition_input_box,
- MMI_multitap_x,
- g_pen_editor_composition_input_box.y);
- g_pen_editor_composition_state.arrow_enable = MMI_FALSE;
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- }
- else
- {
- g_pen_editor_composition_state.arrow_enable = MMI_TRUE;
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
- if (mmi_pen_editor_composition_is_able_to_next() && PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == candiate_state)
- {
- g_pen_editor_composition_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- if (mmi_pen_editor_composition_is_able_to_prev() && PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == candiate_state)
- {
- g_pen_editor_composition_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
- }
- gui_resize_single_line_input_box(
- &g_pen_editor_composition_input_box,
- g_pen_editor_composition_input_box.grid_width * PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS,
- g_pen_editor_composition_input_box.height);
- gui_move_single_line_input_box(
- &g_pen_editor_composition_input_box,
- MMI_multitap_x + g_pen_editor_composition_input_box.grid_width,
- g_pen_editor_composition_input_box.y);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_RIGHT,
- g_pen_editor_composition_state.right_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- mmi_pen_editor_draw_arrow(
- PEN_EDITOR_ARROW_DIRECTION_LEFT,
- g_pen_editor_composition_state.left_arrow_state,
- PEN_EDITOR_ARROW_FOR_COMPOSITION);
- }
- gui_show_single_line_input_box(&g_pen_editor_composition_input_box);
- } /* end of mmi_pen_editor_show_composition_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_append_disable_keys
- * DESCRIPTION
- * To append the default disabled keys in the virtual keyboard
- * PARAMETERS
- * vk_keys_set [OUT] The struct to record the disabled and enabled keys in the virtual keyboard
- * disable_characters [IN] The disabled characters keys
- * disable_event_keys [IN] The disabled event keys
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_append_disable_keys(
- mmi_pen_editor_vk_keys_set_struct *vk_keys_set,
- const UI_character_type *disable_characters,
- const gui_virtual_keyboard_pen_enum *disable_event_keys)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (disable_characters)
- {
- S32 i = 0;
- while (disable_characters[i])
- {
- S32 j = 0;
- while (vk_keys_set->characters_list[j])
- {
- if (disable_characters[i] == vk_keys_set->characters_list[j])
- {
- break;
- }
- j++;
- }
- if (!vk_keys_set->characters_list[j])
- {
- vk_keys_set->characters_list[j] = disable_characters[i];
- vk_keys_set->characters_list[j + 1] = ' ';
- }
- i++;
- }
- }
- if (disable_event_keys)
- {
- S32 i = 0;
- while (disable_event_keys[i])
- {
- S32 j = 0;
- while (vk_keys_set->event_keys_list[j])
- {
- if (disable_event_keys[i] == vk_keys_set->event_keys_list[j])
- {
- break;
- }
- j++;
- }
- if (!vk_keys_set->event_keys_list[j])
- {
- vk_keys_set->event_keys_list[j] = disable_event_keys[i];
- vk_keys_set->event_keys_list[j + 1] = ' ';
- }
- i++;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_disable_keys
- * DESCRIPTION
- * Disable the keys on the virtual keyboard according to the input type and the situation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_disable_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* W06.11 Disable Hide Key in Phone Number Keyboard */
- const UI_character_type *DisableCharacters = gPenEditorEmptyInvalidCharacters;
- const gui_virtual_keyboard_pen_enum *DisableSymbols = gPenEditorVKDisableEmpty;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((gPenEditorInputBoxType == PEN_EDITOR_INLINE_TEXT) ||
- (gPenEditorInputBoxType == PEN_EDITOR_SINGLE_LINE_INPU_BOX) ||
- (MMI_current_input_ext_type & INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL))
- {
- DisableSymbols = gPenEditorVKDisableNewLine;
- }
- /* W06.06 Disable Caps Lock in Quick Search */
- if ((gPenEditorInputBoxType == PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX))
- {
- DisableSymbols = gPenEditorVKDisableNewLineCapsLock;
- }
- if (INPUT_TYPE_PHONE_NUMBER == (MMI_current_input_type & INPUT_TYPE_MASK))
- {
- if (MMI_current_input_ext_type & INPUT_TYPE_EXT_SIM_NUMERIC)
- {
- DisableCharacters = gPenEditorPhoneNumberSIMInvalidCharacters;
- DisableSymbols = gPenEditorVKDisableHideSpace;
- }
- else
- {
- DisableCharacters = gPenEditorPhoneNumberInvalidCharacters;
- DisableSymbols = gPenEditorVKDisableHideSpace;
- }
- }
- else if (INPUT_TYPE_KEYPAD_NUMERIC == (MMI_current_input_type & INPUT_TYPE_MASK)
- || INPUT_TYPE_SAT_NUMERIC_PASSWORD == (MMI_current_input_type & INPUT_TYPE_MASK))
- {
- DisableCharacters = gPenEditorKeyPadNumbericInvalidCharacters;
- DisableSymbols = gPenEditorVKDisableHideSpace;
- }
- else if (MMI_allow_only_english_input_modes)
- {
- DisableCharacters = gPenEditorUCS2InvalidCharacters;
- }
- if (g_pen_editor_disable_virtual_keyboard)
- {
- wgui_set_virtual_keyboard_allowed_characters(gPenEditorEmptyInvalidCharacters);
- }
- else if (g_pen_editor_vk_keys_set.is_changed)
- {
- if (g_pen_editor_vk_keys_set.is_allowed)
- {
- wgui_set_virtual_keyboard_allowed_characters((const UI_character_type*)g_pen_editor_vk_keys_set.
- characters_list);
- }
- else
- {
- mmi_pen_editor_vk_append_disable_keys(&g_pen_editor_vk_keys_set, DisableCharacters, DisableSymbols);
- wgui_set_virtual_keyboard_disabled_list(
- (const UI_character_type*)g_pen_editor_vk_keys_set.characters_list,
- (const gui_virtual_keyboard_pen_enum*)g_pen_editor_vk_keys_set.event_keys_list);
- }
- }
- else
- {
- wgui_set_virtual_keyboard_disabled_list(DisableCharacters, DisableSymbols);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_vk_keys
- * DESCRIPTION
- * To set the keys in the virtual keyboard
- * PARAMETERS
- * is_allowed [IN] MMI_TRUE : The enabled keys list MMI_FALSE : The Disabled keys list
- * characters_lsit [IN] The character keys
- * disable_event_keys_list [IN] The event keys
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_vk_keys(
- MMI_BOOL is_allowed,
- const UI_character_type *characters_lsit,
- const gui_virtual_keyboard_pen_enum *disable_event_keys_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_vk_keys_set.is_allowed = is_allowed;
- g_pen_editor_vk_keys_set.is_changed = MMI_TRUE;
- if (is_allowed)
- {
- g_pen_editor_vk_keys_set.characters_list = (UI_character_type*) characters_lsit;
- g_pen_editor_vk_keys_set.event_keys_list = NULL;
- }
- else
- {
- U32 num = 0;
- if (characters_lsit)
- {
- num = 0;
- for (;; num++)
- {
- if (' ' == characters_lsit[num])
- {
- break;
- }
- g_pen_editor_vk_characters_disable_list[num] = characters_lsit[num];
- }
- }
- if (disable_event_keys_list)
- {
- num = 0;
- for (;; num++)
- {
- if (GUI_VKBD_PEN_NONE == disable_event_keys_list[num])
- {
- break;
- }
- g_pen_editor_vk_event_keys_disable_list[num] = disable_event_keys_list[num];
- }
- }
- g_pen_editor_vk_keys_set.characters_list = g_pen_editor_vk_characters_disable_list;
- g_pen_editor_vk_keys_set.event_keys_list = g_pen_editor_vk_event_keys_disable_list;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_clear_and_show_virtual_keyboard_area
- * DESCRIPTION
- * Clear the area of the virtual keyboard and draw it
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_clear_and_show_virtual_keyboard_area(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- /* W06.02 Disable invalid keys in Virtual Keyboard */
- mmi_pen_editor_vk_disable_keys();
- gui_reset_clip();
- gdi_layer_lock_frame_buffer();
- //KP Jerry disable for avoid softkey area been overlaied by virtual keyboard on 2007-4-23 start
- /*
- if (MMI_virtual_keyboard.height < gPenEditorCandidateInputBox.height)
- {
- changed_height = gPenEditorCandidateInputBox.height - MMI_virtual_keyboard.height;
- }
- */
- //KP Jerry disable for avoid softkey area been overlaied by virtual keyboard on 2007-4-23 end
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- /* To Display Background in the area of the virtual keyboard when list menu */
- if (((PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType) && (!(MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)))
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_show_list_menu_background_outside_area(&MMI_fixed_list_menu,
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1,
- c);
- }
- }
- gui_show_virtual_keyboard(&MMI_virtual_keyboard);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- } /* end of mmi_pen_editor_hide_candidate_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_hide_virtual_keyboard_area
- * DESCRIPTION
- * Clear the area of the virtual keyboard
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_hide_virtual_keyboard_area(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- gui_reset_clip();
- gdi_layer_lock_frame_buffer();
- //KP Jerry disable for avoid softkey area been overlaied by virtual keyboard on 2007-4-23 start
- /*
- if (MMI_virtual_keyboard.height < gPenEditorCandidateInputBox.height)
- {
- changed_height = gPenEditorCandidateInputBox.height - MMI_virtual_keyboard.height;
- }
- */
- //KP Jerry disable for avoid softkey area been overlaied by virtual keyboard on 2007-4-23 end
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- /* To Display Background in the area of the virtual keyboard when list menu */
- if (((PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType) && (!(MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)))
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_show_list_menu_background_outside_area(&MMI_fixed_list_menu,
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- MMI_virtual_keyboard.y - changed_height - 2,
- UI_device_width,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height + changed_height - 1,
- c);
- }
- }
- gdi_layer_unlock_frame_buffer();
- gui_BLT_double_buffer(
- 0,
- MMI_virtual_keyboard.y - 2,
- UI_device_width - 1,
- MMI_virtual_keyboard.y + MMI_virtual_keyboard.height - 1);
- } /* end of mmi_pen_editor_hide_candidate_area */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_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_stroke_down_handler(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height;
- /*----------------------------------------------------------------*/
- /* Local Variables Initializing */
- /*----------------------------------------------------------------*/
- changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if hand writing is not enabled, it should not go here */
- 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();
- }
- /* W05.47 If Chinese Symbol Keyboard, set to PinYin or Zhuyin Virtual Keyboard */
- /* W06.08 Avoid changing handwriting area when stroke down */
- //if (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL==MMI_virtual_keyboard.lang_type)
- //{
- // mmi_pen_editor_vk_symbol_picker();
- //}