展讯的6531平台编辑界面按#键出来的是输入发列表pop框,与之前的老平台对比而言有所不同。
但是用户可能还是习惯之前的切换方式,于是小小的修改了一下。
1.先在文件mmiim_im_switching.c中增加如下三个函数:
#if 1//def __KEY_POUND_CHANGE_INPUT_METHOD__
/*****************************************************************************/
// Description : 获取列表各项值,包括对应索引表的构造
// Global resource dependence :
// Author: Joyce
// Note:按#切换输入法
/*****************************************************************************/
LOCAL void GetIMValuesList(MMIIM_SWITCHING_IM_WIN_DATA_T* win_data_ptr)
{
#if defined MMI_IM_PDA_SUPPORT //需求待定,是否需要区分大小写
//#define IM_KB_NO_CAPS
#endif
#if (defined MMI_IM_PDA_SUPPORT && !defined MMIIM_VKB_FORBID)
#define IM_KB_NO_123 //从物理123进入触摸屏123,而tp123无法进行输入法切换异常
#endif
GUIIM_METHOD_PARAM_T *method_def_ptr = PNULL;
uint16 curlang_im_count = 0;
MMIIM_IM_NAME_T const *cur_lang_im_name_ptr = PNULL;
uint16 curlang_abc_im_count = 0;
MMIIM_IM_NAME_T const *cur_lang_abc_im_name_ptr = PNULL;
uint16 i = 0;
uint16 dest_idx = 0;
BOOLEAN is_tp_support = FALSE;
uint16 cnt_hw = 0;
uint16 cnt_abc = 0;
uint16 cnt_123 = 0;
GUIIM_TYPE_T type_set = GUIIM_TYPE_NONE;
uint16 display_idx = 0;
if(PNULL == win_data_ptr
|| PNULL == win_data_ptr->im_kernel_ptr
|| PNULL == win_data_ptr->im_kernel_ptr->method_param_ptr
|| PNULL == win_data_ptr->im_kernel_ptr->method_param_ptr->im_def_ptr)
{
//SCI_TRACE_LOW:"[MMIIM] InitIMDisplayValues: param is not valid."
SCI_TRACE_ID(TRACE_TOOL_CONVERT,MMIIM_IM_SWITCHING_2752_112_2_18_2_25_8_42,(uint8*)"");
return;
}
method_def_ptr = win_data_ptr->im_kernel_ptr->method_param_ptr;
type_set = method_def_ptr->type_set;
is_tp_support = (GUIIM_INPUT_TYPE_TOUCHPEN == method_def_ptr->im_def_ptr->input
|| GUIIM_INPUT_TYPE_TP_QWERT == method_def_ptr->im_def_ptr->input
|| GUIIM_INPUT_TYPE_HANDWRITING == method_def_ptr->im_def_ptr->input);
switch (win_data_ptr->last_lang)
{
#ifdef IM_ENGLISH_SUPPORT
case GUIIM_LANG_ENGLISH:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_english_im_tp_name_list : s_english_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
}
break;
#endif
#ifdef IM_SIMP_CHINESE_SUPPORT
case GUIIM_LANG_CHS:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_simpchs_im_tp_name_list : s_simpchs_im_name_list;
curlang_im_count = 2;
}
#endif
}
break;
#endif
#ifdef IM_TRAD_CHINESE_SUPPORT
case GUIIM_LANG_CHT:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_tradchs_im_tp_name_list : s_tradchs_im_name_list;
curlang_im_count = 2;
}
#endif
}
break;
#endif
#ifdef IM_ARABIC_SUPPORT
case GUIIM_LANG_ARABIC:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_arabic_im_tp_name_list : s_arabic_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_arabic_abc_im_tp_name_list : s_arabic_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_FRENCH_SUPPORT
case GUIIM_LANG_FRENCH:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_french_im_tp_name_list : s_french_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_french_abc_im_tp_name_list : s_french_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_GERMAN_SUPPORT
case GUIIM_LANG_GERMAN:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_german_im_tp_name_list : s_german_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_german_abc_im_tp_name_list : s_german_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_GREEK_SUPPORT
case GUIIM_LANG_GREEK:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_greek_im_tp_name_list : s_greek_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_greek_abc_im_tp_name_list : s_greek_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_HINDI_SUPPORT
case GUIIM_LANG_HINDI:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_hidi_im_tp_name_list : s_hidi_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_hidi_abc_im_tp_name_list : s_hidi_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_HUNGARIAN_SUPPORT
case GUIIM_LANG_HUNGARIAN:
{
#if (defined IM_ENGINE_CSTAR)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_hungarian_im_tp_name_list : s_hungarian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_hungarian_abc_im_tp_name_list : s_hungarian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_INDONESIAN_SUPPORT
case GUIIM_LANG_INDONESIAN:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_indonesian_im_tp_name_list : s_indonesian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_indonesian_abc_im_tp_name_list : s_indonesian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ITALIAN_SUPPORT
case GUIIM_LANG_ITALIAN:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_italian_im_tp_name_list : s_italian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_italian_abc_im_tp_name_list : s_italian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_MALAY_SUPPORT
case GUIIM_LANG_MALAY:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_malay_im_tp_name_list : s_malay_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_malay_abc_im_tp_name_list : s_malay_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_PERSIAN_SUPPORT
case GUIIM_LANG_PERSIAN:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_persian_im_tp_name_list : s_persian_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_persian_abc_im_tp_name_list : s_persian_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_PORTUGUESE_SUPPORT
case GUIIM_LANG_PORTUGUESE:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_portuguese_im_tp_name_list : s_portuguese_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_portuguese_abc_im_tp_name_list : s_portuguese_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_RUSSIAN_SUPPORT
case GUIIM_LANG_RUSSIAN:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_russian_im_tp_name_list : s_russian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_russian_abc_im_tp_name_list : s_russian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SPANISH_SUPPORT
case GUIIM_LANG_SPANISH:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_spanish_im_tp_name_list : s_spanish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_spanish_abc_im_tp_name_list : s_spanish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_TAGALOG_SUPPORT
case GUIIM_LANG_TAGALOG:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_tagalog_im_tp_name_list : s_tagalog_im_name_list;;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_tagalog_abc_im_tp_name_list : s_tagalog_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_THAI_SUPPORT
case GUIIM_LANG_THAI:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_thai_im_tp_name_list : s_thai_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_thai_abc_im_tp_name_list : s_thai_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_TURKISH_SUPPORT
case GUIIM_LANG_TURKISH:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_turkish_im_tp_name_list : s_turkish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_turkish_abc_im_tp_name_list : s_turkish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_URDU_SUPPORT
case GUIIM_LANG_URDU:
{
#if defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_urdu_im_tp_name_list : s_urdu_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_urdu_abc_im_tp_name_list : s_urdu_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_VIETNAMESE_SUPPORT
case GUIIM_LANG_VIETNAMESE:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_vietnamese_im_tp_name_list : s_vietnamese_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_vietnamese_abc_im_tp_name_list : s_vietnamese_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_HEBREW_SUPPORT
case GUIIM_LANG_HEBREW:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_hebrew_im_tp_name_list : s_hebrew_im_name_list;
curlang_im_count = 1;
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_hebrew_abc_im_tp_name_list : s_hebrew_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_BENGALI_SUPPORT
case GUIIM_LANG_BENGALI:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_bengali_im_tp_name_list : s_bengali_im_name_list;
curlang_im_count = 1;
}
#endif
/*NEWMS00229848后续处理:当时因孟加拉语输入法不正确而不支持Be,现去掉不支持的输入法GUIIM_M_BENGALI_ABC/GUIIM_M_TP_BENGALI_ABC
详见bug89651 注意:以后如果sogou下孟加拉语输入问题解决,此处注释必须去掉,并需要同步修改mmitheme_im.c*/
#ifndef IM_ENGINE_SOGOU
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_bengali_abc_im_tp_name_list : s_bengali_abc_im_name_list;
curlang_abc_im_count = 1;
#endif
}
break;
#endif
#ifdef IM_CZECH_SUPPORT
case GUIIM_LANG_CZECH:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_czech_im_tp_name_list : s_czech_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_czech_abc_im_tp_name_list : s_czech_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SLOVENIAN_SUPPORT
case GUIIM_LANG_SLOVENIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_slovenian_im_tp_name_list : s_slovenian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_slovenian_abc_im_tp_name_list : s_slovenian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ROMANIAN_SUPPORT
case GUIIM_LANG_ROMANIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_romanian_im_tp_name_list : s_romanian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_romanian_abc_im_tp_name_list : s_romanian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_TELUGU_SUPPORT
case GUIIM_LANG_TELUGU:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_telugu_im_tp_name_list : s_telugu_im_name_list;
curlang_im_count = 1;
}
#endif
//泰卢固语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_telugu_abc_im_tp_name_list: s_telugu_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_MARATHI_SUPPORT
case GUIIM_LANG_MARATHI:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_marathi_im_tp_name_list : s_marathi_im_name_list;
curlang_im_count = 1;
}
#endif
//马拉地语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_marathi_abc_im_tp_name_list : s_marathi_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_TAMIL_SUPPORT
case GUIIM_LANG_TAMIL:
{
#if (defined IM_ENGINE_CSTAR || defined IM_ENGINE_SOGOU)
{
cur_lang_im_name_ptr = (is_tp_support) ? s_tamil_im_tp_name_list : s_tamil_im_name_list;
curlang_im_count = 1;
}
#endif
//泰米尔语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_tamil_abc_im_tp_name_list : s_tamil_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_GUJARATI_SUPPORT
case GUIIM_LANG_GUJARATI:
{
/*#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_gujarati_im_tp_name_list : s_gujarati_im_name_list;
curlang_im_count = 1;
}
#endif*/
//古吉拉特语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_gujarati_abc_im_tp_name_list : s_gujarati_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_KANNADA_SUPPORT
case GUIIM_LANG_KANNADA:
{
//卡纳达multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_kannada_abc_im_tp_name_list : s_kannada_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_MALAYALAM_SUPPORT
case GUIIM_LANG_MALAYALAM:
{
//马拉亚拉姆multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_malayalam_abc_im_tp_name_list : s_malayalam_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
//缅甸
#ifdef IM_MYANMAR_SUPPORT
case GUIIM_LANG_MYANMAR:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_myanmar_im_tp_name_list : s_myanmar_im_name_list;
curlang_im_count = 1;
}
#endif
//缅甸multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_myanmar_abc_im_tp_name_list : s_myanmar_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_ORIYA_SUPPORT
case GUIIM_LANG_ORIYA:
{
//奥里亚multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_oriya_abc_im_tp_name_list : s_oriya_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_PUNJABI_SUPPORT
case GUIIM_LANG_PUNJABI:
{
#if defined IM_ENGINE_SOGOU
//{
// cur_lang_im_name_ptr = (is_tp_support) ? s_punjabi_im_tp_name_list : s_punjabi_im_name_list;
// curlang_im_count = 1;
//}
#endif
//旁遮普multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_punjabi_abc_im_tp_name_list : s_punjabi_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_AFRIKAANS_SUPPORT
case GUIIM_LANG_AFRIKAANS:
{
//南非荷兰语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_afrikaans_abc_im_tp_name_list: s_afrikaans_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ALBANIAN_SUPPORT
case GUIIM_LANG_ALBANIAN:
{
//阿尔巴尼亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_albanian_abc_im_tp_name_list: s_albanian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ARMENIAN_SUPPORT
case GUIIM_LANG_ARMENIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_armenian_im_tp_name_list : s_armenian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
// 亚美尼亚语语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_armenian_abc_im_tp_name_list: s_armenian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_AZERBAIJANI_SUPPORT
case GUIIM_LANG_AZERBAIJANI:
{
// 阿塞拜疆语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_azerbaijani_abc_im_tp_name_list: s_azerbaijani_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_BASQUE_SUPPORT
case GUIIM_LANG_BASQUE:
{
// 巴斯克语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_basque_abc_im_tp_name_list: s_basque_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_BULGARIAN_SUPPORT
case GUIIM_LANG_BULGARIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_bulgarian_im_tp_name_list : s_bulgarian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_bulgarian_abc_im_tp_name_list : s_bulgarian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_CATALAN_SUPPORT
case GUIIM_LANG_CATALAN:
{
// 加泰罗尼亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_catalan_abc_im_tp_name_list: s_catalan_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_CROATIAN_SUPPORT
case GUIIM_LANG_CROATIAN:
{
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_croatian_abc_im_tp_name_list : s_croatian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_DANISH_SUPPORT
case GUIIM_LANG_DANISH:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_danish_im_tp_name_list : s_danish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_danish_abc_im_tp_name_list : s_danish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_DUTCH_SUPPORT
case GUIIM_LANG_DUTCH:
{
#if defined IM_ENGINE_CSTAR
cur_lang_im_name_ptr = (is_tp_support) ? s_dutch_im_tp_name_list : s_dutch_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_dutch_abc_im_tp_name_list : s_dutch_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ESTONIAN_SUPPORT
case GUIIM_LANG_ESTONIAN:
{
// 爱沙尼亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_estonian_abc_im_tp_name_list: s_estonian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_FILIPINO_SUPPORT
case GUIIM_LANG_FILIPINO:
{
//菲律宾multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_filipino_abc_im_tp_name_list: s_filipino_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_FINNISH_SUPPORT
case GUIIM_LANG_FINNISH:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_finnish_im_tp_name_list : s_finnish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
//芬兰multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_finnish_abc_im_tp_name_list: s_finnish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_GALICIAN_SUPPORT
case GUIIM_LANG_GALICIAN:
{
// 加利西亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_galician_abc_im_tp_name_list: s_galician_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_GEORGIAN_SUPPORT
case GUIIM_LANG_GEORGIAN:
{
// 格鲁吉亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_georgian_abc_im_tp_name_list : s_georgian_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_HAUSA_SUPPORT
case GUIIM_LANG_HAUSA:
{
#if defined IM_ENGINE_SOGOU
cur_lang_im_name_ptr = (is_tp_support) ? s_hausa_im_tp_name_list : s_hausa_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
#endif
// 豪撒语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_hausa_abc_im_tp_name_list: s_hausa_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_ICELANDIC_SUPPORT
case GUIIM_LANG_ICELANDIC:
{
// 冰岛语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_icelandic_abc_im_tp_name_list: s_icelandic_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_IGBO_SUPPORT
case GUIIM_LANG_IGBO:
{
// 伊博语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_igbo_abc_im_tp_name_list: s_igbo_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_IRISH_SUPPORT
case GUIIM_LANG_IRISH:
{
// 爱尔兰语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_irish_abc_im_tp_name_list: s_irish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_KAZAKH_SUPPORT
case GUIIM_LANG_KAZAKH:
{
// 哈萨克斯坦multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_kazakh_abc_im_tp_name_list: s_kazakh_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_LATVIAN_SUPPORT
case GUIIM_LANG_LATVIAN:
{
//拉脱维亚multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_latvian_abc_im_tp_name_list: s_latvian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_LITHUANIAN_SUPPORT
case GUIIM_LANG_LITHUANIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_lithuanian_im_tp_name_list : s_lithuanian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_lithuanian_abc_im_tp_name_list : s_lithuanian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_MACEDONIAN_SUPPORT
case GUIIM_LANG_MACEDONIAN:
{
//马其顿multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_macedonian_abc_im_tp_name_list: s_macedonian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_MOLDOVAN_SUPPORT
case GUIIM_LANG_MOLDOVAN:
{
// 摩尔多瓦语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_moldovan_abc_im_tp_name_list: s_moldovan_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_NORWEGIAN_SUPPORT
case GUIIM_LANG_NORWEGIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_norwegian_im_tp_name_list : s_norwegian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_norwegian_abc_im_tp_name_list : s_norwegian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_POLISH_SUPPORT
case GUIIM_LANG_POLISH:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_polish_im_tp_name_list : s_polish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_polish_abc_im_tp_name_list : s_polish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SERBIAN_SUPPORT
case GUIIM_LANG_SERBIAN:
{
// 塞尔维亚语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_serbian_abc_im_tp_name_list: s_serbian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SESOTHO_SUPPORT
case GUIIM_LANG_SESOTHO:
{
// 塞索托语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_sesotho_abc_im_tp_name_list: s_sesotho_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SLOVAK_SUPPORT
case GUIIM_LANG_SLOVAK:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_slovak_im_tp_name_list : s_slovak_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_slovak_abc_im_tp_name_list : s_slovak_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_SWEDISH_SUPPORT
case GUIIM_LANG_SWEDISH:
{
#if defined IM_ENGINE_CSTAR
cur_lang_im_name_ptr = (is_tp_support) ? s_swedish_im_tp_name_list : s_swedish_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_swedish_abc_im_tp_name_list : s_swedish_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_UKRAINIAN_SUPPORT
case GUIIM_LANG_UKRAINIAN:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_ukrainian_im_tp_name_list : s_ukrainian_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_ukrainian_abc_im_tp_name_list : s_ukrainian_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
#ifdef IM_YORUBA_SUPPORT
case GUIIM_LANG_YORUBA:
{
// 约鲁巴语multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_yoruba_abc_im_tp_name_list: s_yoruba_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
//科萨语
#ifdef IM_XHOSA_SUPPORT
case GUIIM_LANG_XHOSA:
{
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_xhosa_abc_im_tp_name_list: s_xhosa_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
//祖鲁语
#ifdef IM_ZULU_SUPPORT
case GUIIM_LANG_ZULU:
{
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_zulu_abc_im_tp_name_list: s_zulu_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
//(印度语支的)阿萨姆语
#ifdef IM_ASSAMESE_SUPPORT
case GUIIM_LANG_ASSAMESE:
{
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_assamese_abc_im_tp_name_list: s_assamese_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
//斯瓦西里语
#ifdef IM_SWAHILI_SUPPORT
case GUIIM_LANG_SWAHILI:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_swahili_im_tp_name_list : s_swahili_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_im_count = 1;
#else
curlang_im_count = 3;
#endif
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_swahili_abc_im_tp_name_list: s_swahili_abc_im_name_list;
#if defined IM_KB_NO_CAPS
curlang_abc_im_count = 1;
#else
curlang_abc_im_count = 3;
#endif
}
break;
#endif
//阿姆哈拉
#ifdef IM_AMHARIC_SUPPORT
case GUIIM_LANG_AMHARIC:
{
//multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_amharic_abc_im_tp_name_list : s_amharic_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
//柬埔寨
#ifdef IM_KHMER_SUPPORT
case GUIIM_LANG_KHMER:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_khmer_im_tp_name_list : s_khmer_im_name_list;
curlang_im_count = 1;
}
#endif
//multitap相关输入
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_khmer_abc_im_tp_name_list : s_khmer_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
//老挝
#ifdef IM_LAO_SUPPORT
case GUIIM_LANG_LAO:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_lao_im_tp_name_list : s_lao_im_name_list;
curlang_im_count = 1; //不存在大小写区分
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_lao_abc_im_tp_name_list: s_lao_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_UYGHUR_SUPPORT
case GUIIM_LANG_UYGHUR:
{
#if defined IM_ENGINE_CSTAR
{
cur_lang_im_name_ptr = (is_tp_support) ? s_uyghur_im_tp_name_list : s_uyghur_im_name_list;
curlang_im_count = 1; //不存在大小写区分
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_uyghur_abc_im_tp_name_list: s_uyghur_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_TIBETAN_SUPPORT //tibetan 2012 0529
case GUIIM_LANG_TIBETAN:
{
// cur_lang_im_name_ptr = (is_tp_support) ? s_tibetan_im_tp_name_list : s_tibetan_im_name_list;
// curlang_im_count = 1; //不存在大小写区分
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_tibetan_abc_im_tp_name_list: s_tibetan_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
#ifdef IM_SINHALESE_SUPPORT
case GUIIM_LANG_SINHALESE:
{
#if defined IM_ENGINE_SOGOU
{
cur_lang_im_name_ptr = (is_tp_support) ? s_sinhalese_im_tp_name_list : s_sinhalese_im_name_list;
curlang_im_count = 1; //不存在大小写区分
}
#endif
cur_lang_abc_im_name_ptr = (is_tp_support) ? s_sinhalese_abc_im_tp_name_list: s_sinhalese_abc_im_name_list;
curlang_abc_im_count = 1;
}
break;
#endif
default:
break;
}
//sprd无智能输入法,从这里修改,免得每个地方需要用宏控制,并一个个的修改
#if defined IM_ENGINE_NONE
curlang_im_count = 0;
#endif
//当前输入语言支持的输入法+通用输入法+语言修改项
if (is_tp_support)
{
#if defined IM_KB_NO_CAPS
cnt_abc = 1;
#else
cnt_abc = ARR_SIZE(s_abc_im_tp_name_list);
#endif
cnt_123 = ARR_SIZE(s_123_im_tp_name_list);
}
else
{
#if defined IM_KB_NO_CAPS
cnt_abc = 1;
#else
cnt_abc = ARR_SIZE(s_abc_im_name_list);
#endif
cnt_123 = ARR_SIZE(s_123_im_name_list);
}
#ifdef IM_KB_NO_123 //virtural keyboard version hasn't 123 in menu
if (MMITHEME_IMTpAllow())
{
cnt_123 = 0; //virtural keyboard version hasn't 123 in menu
}
#endif
#if defined(MMIIM_USE_HANDWRITING)
cnt_hw = ARR_SIZE(s_hw_im_name_list);
#endif
//去掉输入语言设置项,所以此处不+1
win_data_ptr->item_counts = curlang_im_count + curlang_abc_im_count + cnt_hw + cnt_abc + cnt_123;
win_data_ptr->item_ptr =
(MMIIM_IM_NAME_T*)SCI_ALLOC_APP(win_data_ptr->item_counts * sizeof(MMIIM_IM_NAME_T));
SCI_MEMSET(win_data_ptr->item_ptr, 0, win_data_ptr->item_counts * sizeof(MMIIM_IM_NAME_T));
win_data_ptr->menu_table_ptr =
(MMIIM_IM_MENU_T*)SCI_ALLOC_APP(win_data_ptr->item_counts * sizeof(MMIIM_IM_MENU_T));
SCI_MEMSET(win_data_ptr->menu_table_ptr, 0, win_data_ptr->item_counts * sizeof(MMIIM_IM_MENU_T));
//初始化当前输入语言支持的输入法项,从0开始,智能的输入法
for (i = 0; i < curlang_im_count; i++) /*lint !e681*/
{
if (PNULL == cur_lang_im_name_ptr) break;
win_data_ptr->item_ptr[i].txt_id = cur_lang_im_name_ptr[i].txt_id;
win_data_ptr->item_ptr[i].method = cur_lang_im_name_ptr[i].method;
win_data_ptr->item_ptr[i].is_display = ((GUIIM_LIMIT_LOCAL & method_def_ptr->limit) == 0);
}
dest_idx = curlang_im_count;
//初始化当前输入语言支持的输入法项,从智能的最后一项接着,multitap输入法
for (i = 0; i < curlang_abc_im_count; i++)/*lint !e681*/
{
if (PNULL == cur_lang_abc_im_name_ptr) break;
win_data_ptr->item_ptr[dest_idx+i].txt_id = cur_lang_abc_im_name_ptr[i].txt_id;
win_data_ptr->item_ptr[dest_idx+i].method = cur_lang_abc_im_name_ptr[i].method;
win_data_ptr->item_ptr[dest_idx+i].is_display = ((GUIIM_LIMIT_LOCAL & method_def_ptr->limit) == 0);
}
dest_idx += curlang_abc_im_count;
//初始化通用abc输入法项
for (i = 0; i < cnt_abc; i++)
{
if (is_tp_support)
{
win_data_ptr->item_ptr[i+dest_idx].txt_id = s_abc_im_tp_name_list[i].txt_id;
win_data_ptr->item_ptr[i+dest_idx].method = s_abc_im_tp_name_list[i].method;
}
else
{
win_data_ptr->item_ptr[i+dest_idx].txt_id = s_abc_im_name_list[i].txt_id;
win_data_ptr->item_ptr[i+dest_idx].method = s_abc_im_name_list[i].method;
}
win_data_ptr->item_ptr[i+dest_idx].is_display = ((GUIIM_LIMIT_ENGLISH & method_def_ptr->limit) == 0);
}
dest_idx += cnt_abc;
//初始化123输入法项
for (i = 0; i < cnt_123; i++) //lint !e*/
{
if (is_tp_support)
{
win_data_ptr->item_ptr[i+dest_idx].txt_id = s_123_im_tp_name_list[i].txt_id;
win_data_ptr->item_ptr[i+dest_idx].method = s_123_im_tp_name_list[i].method;
}
else
{
win_data_ptr->item_ptr[i+dest_idx].txt_id = s_123_im_name_list[i].txt_id;
win_data_ptr->item_ptr[i+dest_idx].method = s_123_im_name_list[i].method;
}
win_data_ptr->item_ptr[i+dest_idx].is_display = ((GUIIM_LIMIT_DIGITAL & method_def_ptr->limit) == 0);
}
dest_idx += cnt_123;
#if defined(MMIIM_USE_HANDWRITING)
//初始化手写
for (i = 0; i < cnt_hw; i++)
{
win_data_ptr->item_ptr[dest_idx].txt_id = s_hw_im_name_list[i].txt_id;
win_data_ptr->item_ptr[dest_idx].method = s_hw_im_name_list[i].method;
win_data_ptr->item_ptr[dest_idx].is_display = FALSE;
win_data_ptr->item_ptr[dest_idx].is_display = ((GUIIM_INPUT_TYPE_HANDWRITING & method_def_ptr->input_set) != 0);
}
dest_idx++;
#endif
//列表所有项的字符初始化完成,接着建与输入核的索引
display_idx = 0;
for (i = 0; i < win_data_ptr->item_counts; i++)
{
if (win_data_ptr->item_ptr[i].is_display)
{
win_data_ptr->menu_table_ptr[display_idx].idx = display_idx;
win_data_ptr->menu_table_ptr[display_idx].method = win_data_ptr->item_ptr[i].method;
display_idx++;
}
}
}
/*****************************************************************************/
// Description : 切换到列表中的下一个输入法
// Global resource dependence :
// Author: Joyce
// Note:按#切换输入法
/*****************************************************************************/
LOCAL void ChangeNextMethod(MMIIM_SWITCHING_IM_WIN_DATA_T* win_data_ptr)
{
uint16 cur_method_idx = win_data_ptr->item_hot;
uint16 total_method_count = win_data_ptr->item_counts;
uint16 next_method_idx = cur_method_idx + 1;
GUIIM_METHOD_T next_method = win_data_ptr->menu_table_ptr[next_method_idx%total_method_count].method;
MMI_HANDLE_T im_handle = win_data_ptr->im_kernel_ptr->im_handle;
//change method
SendChangeMethodMsg(next_method, im_handle);
}
/*****************************************************************************/
// Description : 开始切换输入法
// Global resource dependence :
// Author: Joyce
// Note:按#切换输入法
/*****************************************************************************/
PUBLIC void MMIIM_StarttoChangeIM(
GUIIM_INIT_KERNEL_T* im_kernel_ptr,
GUI_BOTH_RECT_T disp_rect,
MMIIM_POPMENU_EP_E effective_point
)
{
MMIIM_SWITCHING_IM_WIN_DATA_T *win_data_ptr = PNULL;
GUIIM_LANGUAGE_T lang = GUIIM_LANG_NONE;
MMISET_LANGUAGE_TYPE_E language_type = MMISET_LANGUAGE_ENGLISH;
uint16 nMaxDisplayItem = 0;
uint16 i = 0;
if (PNULL == im_kernel_ptr
|| PNULL == im_kernel_ptr->method_param_ptr)
{
return;
}
win_data_ptr = (MMIIM_SWITCHING_IM_WIN_DATA_T*)SCI_ALLOC_APP(sizeof(MMIIM_SWITCHING_IM_WIN_DATA_T));
SCI_MEMSET(win_data_ptr, 0, sizeof(MMIIM_SWITCHING_IM_WIN_DATA_T));
win_data_ptr->disp_rect.h_rect = disp_rect.h_rect;
win_data_ptr->disp_rect.v_rect = disp_rect.v_rect;
win_data_ptr->effective_point = effective_point;
win_data_ptr->im_kernel_ptr = im_kernel_ptr;
win_data_ptr->user_data_ptr = PNULL;
win_data_ptr->default_method = GUIIM_M_NONE;
//如果当前语言是什么语言都支持,则需要去读一下NV,取出之前保存的输入语言
lang = im_kernel_ptr->method_param_ptr->input_lang;
if (GUIIM_LANG_NONE == lang)
{
lang = MMIAPIIM_GetLanguage();
}
if (GUIIM_LANG_NONE == lang)
{
lang = im_kernel_ptr->method_param_ptr->im_set.lang;
if (GUIIM_LANG_NONE == lang)
{
MMIAPISET_GetLanguageType(&language_type);
lang = MMIAPIIM_GetGUILangBySetLangIdx(language_type);
}
}
win_data_ptr->last_lang = lang;
//先求取一下,是否总共有多少个可以切换的输入
GetIMValuesList(win_data_ptr);
//获取当前输入法在列表中的下标
SetIMFocusIndex(win_data_ptr);
//切换到列表中的下一个输入法
ChangeNextMethod(win_data_ptr);
}
#endif
2.在文件mmiim_sp_multitap.c中搜索函数HandleSysMsg,找到如下代码进行修改:
else if (MMIIM_SP_KEY_HASH == msg.para.key && (PNULL == data_ptr->language_data.custom_kb_ptr))
{
#if 1//def __KEY_POUND_CHANGE_INPUT_METHOD__
MMIIM_StarttoChangeIM(&(data_ptr->init_param), pop_menu_rect, MMIIM_EP_TOP_LEFT);
#else
MMIIM_SetPopMenuRect(data_ptr->init_param.win_handle, &pop_menu_rect);
MMIIM_SwitchingCreateWin(&(data_ptr->init_param), pop_menu_rect, MMIIM_EP_TOP_LEFT);
#endif
is_dealt = TRUE;
}
3.如果你开启了CSTAR或者SOGO输入法,还需要在在相应的文件中修改函数OpenSwitchIMWin()中的如下代码:
//输入法控件统一处理切换输入法
#if 1//def __KEY_POUND_CHANGE_INPUT_METHOD__
MMIIM_StarttoChangeIM(&(data_ptr->init_param), *pop_menu_rect_ptr, MMIIM_EP_TOP_LEFT);
#else
MMIIM_SetPopMenuRect(data_ptr->init_param.win_handle, pop_menu_rect_ptr);
MMIIM_SwitchingCreateWin(&(data_ptr->init_param), *pop_menu_rect_ptr, MMIIM_EP_TOP_LEFT);
#endif
以上3步完成后,即可使用#键切换输入法了,已经在modis上验证过,效果很完美的。哈哈……