📄 zi8hmi.c
字号:
//static int IMEstartX;
//static int IMEstartY;
static int IMEmaxCols;
/* static int IMEmaxRows; */
static int IMEcurPos;
static ZI8WCHAR IMEinline[MAX_ELEMENT_BUFFERSIZE + 1];
static int IMEprediction;
static ZI8BOOL IMEactive;
/* static ZI8BOOL IMEcaretOn; */
static INPUT_MODE IMEmethod;
static ZI8UCHAR IMElastLetterCase;
static ZI8UCHAR IMElastSubLanguage;
/* static PIMEPROCESSKEYFUNC IMElastProcessKeyFunc; */
static PIMEPROCESSKEYFUNC IMEprocessKeyFunc;
static ZI8GETPARAM IMEzi8GetParam;
static ZI8WCHAR IMEelementBuffer[MAX_ELEMENT_BUFFERSIZE + 1];
static ZI8WCHAR IMEwordBuffer[MAX_WORD_BUFFERSIZE + 1];
static ZI8WCHAR IMEcandidateBuffer[MAX_CAND_BUFFERSIZE + 1];
static ZI8WCHAR IMEphoneticBuffer[MAX_PHONETIC_BUFFERSIZE + 1];
#if defined __MMI_ZI_USING_PSCRATCH_BUFFER__
static ZI8UCHAR IMEScratchBuffer[1536];
#endif
static ZI8WCHAR IMEfirstCandidate;
static ZI8UCHAR IMEelementCount;
static ZI8UCHAR IMEwordCharacterCount;
static ZI8BOOL IMEbValidPhonetic;
static ZI8BOOL IMEbFocusOnPhonetic;
static ZI8BOOL IMEbPhoneticComfirmed;
static ZI8WCHAR IMEpPhoneticPtr[MAX_PHONETIC_CANDSIZE][30];
static ZI8UCHAR IMEphoneticIndex;
static ZI8UCHAR IMEphoneticBase;
static ZI8UCHAR IMEphoneticCount;
static ZI8WCHAR IMEtoneMark;
static ZI8BOOL IMEbValidCandidates;
static ZI8UCHAR IMEcandIndex;
static ZI8UCHAR IMEcandCount;
static ZI8BOOL IMEbValidAlphaWords;
static ZI8UCHAR IMEalphaCount;
static ZI8UCHAR COindexs[MAX_CHAR_PER_LINE];
static ZI8WCHAR COcands[MAX_CHAR_PER_LINE];
static ZI8WCHAR lastKeyID;
static int index;
static ZI8BOOL IMEdoWordCand;
static UI_string_type temp_left_softkey_text;
#define MAX_SYM_PER_KEY 5
#define ZI8_ZH_SPACE 0x0020
static ZI8WCHAR ZI8ROMDATA IMElayoutPY[12][MAX_SYM_PER_KEY] =
{
{0},
{ZI8_CODE_PINYIN_A, ZI8_CODE_PINYIN_B, ZI8_CODE_PINYIN_C},
{ZI8_CODE_PINYIN_D, ZI8_CODE_PINYIN_E, ZI8_CODE_PINYIN_F},
{ZI8_CODE_PINYIN_G, ZI8_CODE_PINYIN_H, ZI8_CODE_PINYIN_I},
{ZI8_CODE_PINYIN_J, ZI8_CODE_PINYIN_K, ZI8_CODE_PINYIN_L},
{ZI8_CODE_PINYIN_M, ZI8_CODE_PINYIN_N, ZI8_CODE_PINYIN_O},
{ZI8_CODE_PINYIN_P, ZI8_CODE_PINYIN_Q, ZI8_CODE_PINYIN_R, ZI8_CODE_PINYIN_S},
{ZI8_CODE_PINYIN_T, ZI8_CODE_PINYIN_U, ZI8_CODE_PINYIN_V},
{ZI8_CODE_PINYIN_W, ZI8_CODE_PINYIN_X, ZI8_CODE_PINYIN_Y, ZI8_CODE_PINYIN_Z},
{0},
{ZI8_CODE_TONES_1, ZI8_CODE_TONES_2, ZI8_CODE_TONES_3, ZI8_CODE_TONES_4,
ZI8_CODE_TONES_5}
};
static ZI8WCHAR ZI8ROMDATA IMElayoutZY[12][MAX_SYM_PER_KEY] =
{
{ZI8_CODE_BPMF_B, ZI8_CODE_BPMF_P, ZI8_CODE_BPMF_M, ZI8_CODE_BPMF_F,},
{ZI8_CODE_BPMF_D, ZI8_CODE_BPMF_T, ZI8_CODE_BPMF_N, ZI8_CODE_BPMF_L,},
{ZI8_CODE_BPMF_G, ZI8_CODE_BPMF_K, ZI8_CODE_BPMF_H,},
{ZI8_CODE_BPMF_J, ZI8_CODE_BPMF_Q, ZI8_CODE_BPMF_X,},
{ZI8_CODE_BPMF_ZH, ZI8_CODE_BPMF_CH, ZI8_CODE_BPMF_SH, ZI8_CODE_BPMF_R,},
{ZI8_CODE_BPMF_Z, ZI8_CODE_BPMF_C, ZI8_CODE_BPMF_S},
{ZI8_CODE_BPMF_A, ZI8_CODE_BPMF_O, ZI8_CODE_BPMF_E, ZI8_CODE_BPMF_EH},
{ZI8_CODE_BPMF_AI, ZI8_CODE_BPMF_EI, ZI8_CODE_BPMF_AU, ZI8_CODE_BPMF_OU},
{ZI8_CODE_BPMF_AN, ZI8_CODE_BPMF_EN, ZI8_CODE_BPMF_ANG, ZI8_CODE_BPMF_ENG,
ZI8_CODE_BPMF_ER},
{ZI8_CODE_BPMF_I, ZI8_CODE_BPMF_U, ZI8_CODE_BPMF_IU},
{ZI8_CODE_TONES_1, ZI8_CODE_TONES_2, ZI8_CODE_TONES_3, ZI8_CODE_TONES_4,
ZI8_CODE_TONES_5}
};
static ZI8UCHAR COindexs[MAX_CHAR_PER_LINE];
static ZI8WCHAR COcands[MAX_CHAR_PER_LINE];
/*****************************************************************************
* FUNCTION
* ZiUpdateLSKString
* DESCRIPTION
* Update the temp_left_softkey_txt from MMI_left_softkey_text
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ZiUpdateLSKString(void)
{
#if !defined(MMI_LOW_MEMORY_PHONE)
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
temp_left_softkey_text = MMI_softkeys[MMI_LEFT_SOFTKEY].text;
#else /* !defined(MMI_LOW_MEMORY_PHONE) */
temp_left_softkey_text = MMI_left_softkey.text;
#endif /* !defined(MMI_LOW_MEMORY_PHONE) */
}
/*****************************************************************************
* FUNCTION
* CenterOutCandidates
* DESCRIPTION
*
* PARAMETERS
* numOfCand [IN]
* RETURNS
*
*****************************************************************************/
static ZI8UCHAR CenterOutCandidates(ZI8UCHAR numOfCand)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
int i, j, k;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < sizeof(COindexs); i++)
{
COindexs[i] = i;
}
if (numOfCand <= 2)
{
return (0);
}
j = numOfCand / 2;
COindexs[j] = 0;
COcands[j] = IMEcandidateBuffer[0];
for (i = j - 1, k = 1; i >= 0; i--, k += 2)
{
COindexs[i] = k;
COcands[i] = IMEcandidateBuffer[k];
}
for (i = j + 1, k = 2; i < numOfCand; i++, k += 2)
{
COindexs[i] = k;
COcands[i] = IMEcandidateBuffer[k];
}
for (i = 0; i < numOfCand; i++)
{
IMEcandidateBuffer[i] = COcands[i];
}
return (j);
}
/*****************************************************************************
* FUNCTION
* CenterOutIndex
* DESCRIPTION
*
* PARAMETERS
* uIndex [IN]
* RETURNS
*
*****************************************************************************/
static ZI8UCHAR CenterOutIndex(ZI8UCHAR uIndex)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return (COindexs[uIndex]);
}
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */
/*****************************************************************************
* FUNCTION
* IMEdeleteChar
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
*
*****************************************************************************/
static ZI8BOOL IMEdeleteChar(void)
{
#if !defined(MMI_LOW_MEMORY_PHONE) || defined(__MMI_MESSAGES_EMS__)
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_28_FLAG))
{
gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
}
else
#endif /* !defined(MMI_LOW_MEMORY_PHONE) || defined(__MMI_MESSAGES_EMS__) */
if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_5_FLAG))
{
gui_multi_line_input_box_delete_character(&MMI_multiline_inputbox);
/* setup the inline edit changed flag */
inline_full_screen_edit_changed = 1;
multiline_inputbox_input_callback();
}
else if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_SINGLELINE_INPUTBOX_FLAG))
{
gui_single_line_input_box_delete_character(&MMI_singleline_inputbox);
}
else if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_INLINE_MULTILINE_INPUTBOX_FLAG))
{
gui_multi_line_input_box_delete_character(&MMI_multiline_inputbox);
multiline_inputbox_input_callback();
}
return (ZI8TRUE);
}
/*****************************************************************************
* FUNCTION
* IMEinsertChar
* DESCRIPTION
*
* PARAMETERS
* wcChar [IN]
* RETURNS
*
*****************************************************************************/
static ZI8BOOL IMEinsertChar(ZI8WCHAR wcChar)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if !defined(MMI_LOW_MEMORY_PHONE) || defined(__MMI_MESSAGES_EMS__)
if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_28_FLAG))
{
/* Removed by Ankit Start */ //#ifdef __MMI_LANG_ARABIC__
#ifdef MMI_LOW_MEMORY_PHONE
CharacterInsertedFlag = 1;
#endif
/* Removed by Ankit Start */ //#endif /* __MMI_LANG_ARABIC__ */
gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, wcChar);
}
else
#endif /* !defined(MMI_LOW_MEMORY_PHONE) || defined(__MMI_MESSAGES_EMS__) */
if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_5_FLAG))
{
/* PMT Dara 24/11/04 ....to take the decision when to dispaly the composition window */
#ifdef MMI_LOW_MEMORY_PHONE
CharacterInsertedFlag = 1;
#endif
/* PMT end */
gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, wcChar);
}
else if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_SINGLELINE_INPUTBOX_FLAG))
{
gui_single_line_input_box_insert_character(&MMI_singleline_inputbox, wcChar);
}
else if ((ziInputMethodCategoryFlag & ZI_IN_CATEGORY_INLINE_MULTILINE_INPUTBOX_FLAG))
{
gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, wcChar);
}
/* setup the inline edit changed flag */
inline_full_screen_edit_changed = 1;
if (IMEnumOfChars >= IMEmaxBufferSize)
{
return (ZI8FALSE);
}
switch (IMEmethod)
{
case INPUT_EZI_MULTITAP_BOPOMOFO:
IMEmethodZH = IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_MULTITAP_PINYIN:
IMEmethodZH = IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_STROKE:
IMEmethodZH = IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_PINYIN:
IMEmethodZH = IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_BOPOMOFO:
IMEmethodZH = IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_ABC:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_RUSSIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_BULGARIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_FRENCH:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_GERMAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_ITALIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_SPANISH:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_POLISH:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_NORWEGIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_ABC:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_SLOVAK:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_DUTCH:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_SWEDISH:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_CROATIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_ROMANIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_SLOVENIAN:
IMEmethodLast = IMEmethod;
break;
case INPUT_EZI_GREEK:
IMEmethodLast = IMEmethod;
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -