diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index 448ec96..909942d 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -198,7 +198,7 @@ host = _scim_config->read(String(SCIM_CONFIG_WNN_SERVER),String("localhost")); rc = _scim_config->read(String(SCIM_CONFIG_WNN_RC),String("/usr/lib/wnn7/ja_JP/wnnenvrc")); alp = _scim_config->read(String(SCIM_CONFIG_WNN_ALP),SCIM_DEFAULT_WNN_ALP); - + m_iconv.set_encoding ("EUC-JP"); // �ǥե���ȥ������ꡣ // ����ե����뤫���ɤ�褦�ˤ��Ƥ��ˤ礴�ˤ硣 @@ -460,6 +460,25 @@ alp_count = 1; return(true); } else + if (k_convert_hiragana.comp(key) || k_convert_katakana.comp(key)) { + WideString res = m_convList.Yomi; + k_convert_hiragana.comp(key) ? m_rk.convKataHira(res) : m_rk.convHiraKata(res); + for(unsigned int i = 0;i < m_convList.count;i ++) { + if (res == m_convList.kouho[i]) { + m_convList.pos = i; + wnn.select(m_convList.pos); + update_preedit_string(wnn.getText(),wnn.getAttributeList()); + update_preedit_caret(wnn.getCaretPos()); + if (m_lookup) { + m_lookup_table.set_cursor_pos(m_convList.pos); + update_lookup_table(m_lookup_table); + show_lookup_table(); + } + break; + } + } + return(true); + } else if (isprint(key.code)) { if (key.mask & (SCIM_KEY_AltMask | SCIM_KEY_ControlMask)) return(false); if (m_lookup) { diff --git a/scim-wnn/src/scim_wnn_imengine.h b/scim-wnn/src/scim_wnn_imengine.h index eef64f3..42edc0c 100644 --- a/scim-wnn/src/scim_wnn_imengine.h +++ b/scim-wnn/src/scim_wnn_imengine.h @@ -91,6 +91,7 @@ String host; String rc; bool m_connected; + IConvert m_iconv; protected: bool process_preedit_key_event(const KeyEvent &key); bool process_conversion_key_event(const KeyEvent &key); diff --git a/scim-wnn/src/wnnconversion.cpp b/scim-wnn/src/wnnconversion.cpp index bb7aed8..fe24ae6 100644 --- a/scim-wnn/src/wnnconversion.cpp +++ b/scim-wnn/src/wnnconversion.cpp @@ -287,20 +287,26 @@ */ WnnConversionList WnnConversion::getConversionList(int p) { + w_char k[1024]; + char buf[2048]; + WideString u; convList.kouho.clear(); + convList.Yomi.clear(); convList.pos = 0; convList.count = 0; if (p == -1) p = pos; if ((p >= bunsetu) || (p < 0)) return(convList); pos = p; + wnn_get_area(wnn,pos,pos + 1,k,0); + wstostr((unsigned char*)buf,k); + m_iconv.convert(u,buf,strlen(buf)); + convList.Yomi = u; + convList.pos = jl_zenkouho(wnn,pos,WNN_USE_ZENGO,WNN_UNIQ); convList.count = jl_zenkouho_suu(wnn); convList.kouho.resize(convList.count); for (unsigned int i = 0;i < convList.count; i ++) { - w_char k[1024]; - char buf[2048]; - WideString u; jl_get_zenkouho_kanji(wnn,i,k); wstostr((unsigned char*)buf,k); m_iconv.convert(u,buf,strlen(buf));