📄 editorpen.c
字号:
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* 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!!
*============================================================================
****************************************************************************/
#ifndef _EDITOR_PEN_C
#define _EDITOR_PEN_C
/* 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 __MMI_GB__
#include "gb_wrapper.h"
#include "gbmmi.h"
#endif //__MMI_GB__
/*****************************************************************************
* Define
*****************************************************************************/
// #defined __MMI_HAND_WRITING_GET_STROKES__
#define WGUI_MAX_SOFTKEY_FUNCTIONS 3
// #ifdef DEMO_PROJECT
#define __MMI_HAND_WRITING_EXCLUDE_VK_AREA__
// #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 mmi_gui_virtual_keyboard_language_enum gPenEditorPreviousVirtualKeyboardType = MMI_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 mmi_gui_virtual_keyboard_language_enum gPenEditorHistoryVirtualKeyboardType = MMI_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', '#', '*', '\0' };
/* The valid characters for INPUT_TYPE_KEYPAD_NUMERIC */
const UI_character_type gPenEditorKeyPadNumbericValidCharacters[] =
{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*', '\0' };
/* The valid characters for INPUT_TYPE_EXT_SIM_NUMERIC */
const UI_character_type gPenEditorPhoneNumberSIMValidCharacters[] =
{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '#', '*', '\0' };
/* The valid characters for INPUT_TYPE_DECIMAL_NUMERIC */
const UI_character_type gPenEditorDecimalNumericValidCharacters[] =
{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '\0' };
/* The invalid characters array */
const UI_character_type gPenEditorPhoneNumberInvalidCharacters[] = { '(', ')', '-', ' ', '\0' };
const UI_character_type gPenEditorKeyPadNumbericInvalidCharacters[] = { '(', ')', 'p', 'w', '+', '-', ' ', '\0' };
const UI_character_type gPenEditorPhoneNumberSIMInvalidCharacters[] = { '(', ')', 'p', 'w', '-', ' ', '\0' };
const UI_character_type gPenEditorUCS2InvalidCharacters[] = {0x20ac, '\0' };
const UI_character_type gPenEditorEmptyInvalidCharacters[] = { '\0' };
const mmi_gui_virtual_keyboard_pen_enum gPenEditorVKDisableSpace[] = {GUI_VKBD_PEN_SPACE, GUI_VKBD_PEN_NONE};
const mmi_gui_virtual_keyboard_pen_enum gPenEditorVKDisableNewLine[] = {GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_NONE};
const mmi_gui_virtual_keyboard_pen_enum gPenEditorVKDisableNewLineCapsLock[] =
{GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_CAPSLOCK, GUI_VKBD_PEN_NONE};
const mmi_gui_virtual_keyboard_pen_enum gPenEditorVKDisableEmpty[] = {GUI_VKBD_PEN_NONE};
const mmi_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;
/* W06.11 Do not lock GDI buffer when process mmi_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][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 mmi_gui_virtual_keyboard_pen_enum g_pen_editor_vk_event_keys_disable_list[PEN_EDITOR_VK_MAX_DISABLE_KEYS + 1];
/*****************************************************************************
* Local Function
*****************************************************************************/
/*****************************************************************************
* 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 byte wgui_inline_singleline_inputbox_decimal_input_mode_flag;
extern byte wgui_multiline_inputbox_decimal_input_mode_flag;
extern byte wgui_singleline_inputbox_decimal_input_mode_flag;
extern byte wgui_inline_item_handled;
extern void (*complete_inline_item_edit) (void);
extern byte wgui_inputbox_RSK_label_clear;
extern byte category28_RSK_label_clear;
extern byte 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 UI_image_type inline_text_edit_RSK_label_icon;
extern byte wgui_inline_list_menu_changed;
extern byte 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 pixtel_UI_multi_line_input_box_set_pen_scroll_delay(multi_line_input_box *b, S32 delay_time);
extern void pixtel_UI_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 pixtel_UI_multi_line_input_box_get_remaining_length(multi_line_input_box *b);
extern void EMS_inputbox_previous(void);
extern int pixtel_UI_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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -