diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index c71b055..6e593fd 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -129,7 +129,6 @@ String HonokaFactory::get_uuid () const { - // return String ("c069395a-d62f-4a77-8229-446e44a99976"); return String ("8bb03c1c-db6c-41b1-91bd-b7fb7dd70343"); } @@ -195,7 +194,6 @@ pe.name = p->getName(); pe.dll = plugin; // Ʊ̾�Υץ饰���󤬤��ä����ϥ��ɤ���ߤ��ޤ��� - //if (plugins.find(p->getName()) != plugins.end()) { if (pluginNameList.find(p->getName()) != pluginNameList.end()) { deleteInstance(p); dlclose(plugin); @@ -230,7 +228,6 @@ m_predictor = predictors.at(0); m_multi = new MultiConvertor(_scim_config,this); -// m_multi->connect(); // ������ء� init(); @@ -257,11 +254,6 @@ HonokaInstance::~HonokaInstance() { -/* for(unsigned int i = 0;i < preeditors.size();i ++) { - delete(preeditors.at(i)); - } - if (m_convertor->isConnected()) m_convertor->disconnect(); -*/ for(unsigned int i = 0;i < plugins.size();i ++) { plugins[i].deleteInstance(plugins[i].instance); dlclose(plugins[i].dll); @@ -457,9 +449,10 @@ */ const WideString HonokaInstance::getConvertedText() { + // ���Τ������Ǥϡ��Ѵ�ư��������������������Ǥʤ��ȷ�̤������ʤ��� + // ľ���٤������� vector seglist = m_convertor->getSegmentList(); vector newsegs; - //segments = seglist; WideString t; for(unsigned int i = 0;i < seglist.size();i ++) { if ((i < m_convertor->getPos()) && (segments.size() > i)) { @@ -469,12 +462,7 @@ } else if (i == m_convertor->getPos()) newsegs.push_back(Segment(m_convList.kouho[m_convList.pos].kanji,seglist[i].getYomi())); else newsegs.push_back(seglist[i]); -/* - if (i == m_convertor->getPos()) newsegs.push_back(Segment(m_convList.kouho[m_convList.pos].kanji,seglist[i].getYomi())); - else newsegs.push_back(seglist[i]); -*/ } - //if (m_convList.kouho[m_convList.pos] != newsegs[m_convertor->getPos()]) segments = newsegs; for(unsigned int i = 0;i < segments.size();i ++) { t += segments[i].getKanji(); @@ -916,30 +904,35 @@ (key.code == SCIM_KEY_Hyper_L) || (key.code == SCIM_KEY_Hyper_R)) return true; + // ��ư����ݥåץ��åפΥ�����ȷ׻��� if ((alp <= alp_count) && (alp != 0)) { if (!m_lookup) startLookup(); } + // ��������ݥåץ��åץ��� if (k_lookup_popup.comp(key)) { if (m_lookup) return true; startLookup(); return true; } else + + // ���ڡ������� if (k_lookup_pageup.comp(key)) { if (m_lookup) { lookup_table_page_up(); } } else + + // ��ڡ������� if (k_lookup_pagedown.comp(key)) { if (m_lookup) { lookup_table_page_down(); } } else + + // ���ꥭ�� if (k_commit.comp(key)) { commit_string(getConvertedText()); - //while(preeditStack.size()) { - // preeditStack.pop(); - // } m_convertor->updateFrequency(); if (prediction) if (m_predictor->isConnected()) m_predictor->update(getConvertedText(),m_preeditor->getText(true)); m_preeditor->reset(); @@ -952,6 +945,8 @@ updateProperty(); return true; } else + + // ��̤�PreEditor���᤹������ if (k_result_to_preedit.comp(key)) { preeditStack.push(m_preeditor->getText()); m_preeditor->reset(); @@ -967,6 +962,8 @@ updatePreEditor(); return true; } else + + // ����󥻥륭���� if (k_cancel.comp(key) || k_backspace.comp(key)) { m_convertor->reset(); m_conversion = false; @@ -977,6 +974,8 @@ updatePreEditor(); return true; } else + + // ������/�����䥭���� if (k_conversion_next.comp(key) || k_conversion_prev.comp(key)) { k_conversion_prev.comp(key) ? m_convList.pos --: m_convList.pos ++; if (m_convList.pos >= m_convList.count()) m_convList.pos = 0; @@ -987,6 +986,8 @@ updateConversion(); return true; } else + + // ����ʸ��Ƚ̥����� if (k_conversion_expand.comp(key) || k_conversion_shrink.comp(key)) { m_no_update = false; bool r; @@ -1000,6 +1001,8 @@ alp_count = 1; return true; } else + + // Ϣ���Ѵ�(�ü죱)���� if (k_conversion_rensou.comp(key)) { m_no_update = false; m_convList = m_convertor->getResultList(m_convertor->getPos(),SPECIAL1); @@ -1009,6 +1012,8 @@ alp_count = 1; return true; } else + + // �۷����Ѵ�(�ü죲)������ if (k_conversion_ikeiji.comp(key)) { m_no_update = false; m_convList = m_convertor->getResultList(m_convertor->getPos(),SPECIAL2); @@ -1018,6 +1023,8 @@ alp_count = 1; return true; } else + + // ����ʸ���ư������ if (k_conversion_forward.comp(key) || k_conversion_backward.comp(key)) { m_no_update = false; k_conversion_backward.comp(key) ? m_convertor->setPos(m_convertor->getPos() - 1) : m_convertor->setPos(m_convertor->getPos() + 1); @@ -1029,6 +1036,8 @@ 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_preeditor->convKataHira(res) : m_preeditor->convHiraKata(res); @@ -1042,6 +1051,8 @@ } return true; } else + + // ��/���Ѵ����󥸥��ڤ��ؤ������� if ((k_next_convertor.comp(key) || k_prev_convertor.comp(key)) && (m_convertor != m_multi)) { for(unsigned int i = 0;i < convertors.size();i ++) { if (convertors[i]->getName() == m_convertor->getName()) { @@ -1061,6 +1072,8 @@ } } } else + + // ���������ˤ��������� if (numkeyselect && m_lookup) { for(unsigned int i = 0;i < 10;i ++) { if (k_selection[i].comp(key)) { @@ -1078,6 +1091,8 @@ } } } + + // ����ʸ��θ�������Ѵ����󥸥󤫤�������륭���� if (m_convertor != m_multi) { for(unsigned int i = 0;i < k_convertor.size();i ++) { if (k_convertor[i].comp(key) && (convertors[i] != m_convertor)) { @@ -1097,31 +1112,8 @@ } } - if (key.get_ascii_code()) { - /* - if (key.mask & (SCIM_KEY_AltMask | SCIM_KEY_ControlMask)) return false; - if (m_lookup && numkeyselect) { - char numk[] = "1234567890"; - int numc = 0; - bool numkey = false; - for(;numk[numc]; ++ numc) { - if (key.get_ascii_code() == numk[numc]) { - numkey = true; - break; - } - } - if (numkey) { - if (m_lookup_table.get_current_page_size() < numc) return true; - m_convList.pos = numc + m_lookup_table.get_current_page_start(); - m_convertor->select(m_convList.pos); - m_convertor->setPos(m_convertor->getPos() + 1); - m_convList = m_convertor->getResultList(); - updateConversion(); - startLookup(); - return true; - } - } - */ + // ����ʳ��Υ����ξ�硢ɽ����ǽ�����ʤ���ꤷ��PreEdit���Ϥ�Ƴ��� + if (key.get_ascii_code()) { // ����Ǥ��Դ�����ľ���� commit_string(getConvertedText()); m_convertor->updateFrequency(); if (prediction) if (m_predictor->isConnected()) m_predictor->update(getConvertedText(),m_preeditor->getText(true)); @@ -1210,17 +1202,6 @@ } if (!key.get_ascii_code()) return true; -/* if ((!(key.is_control_down() || key.is_alt_down() || key.is_shift_down())) && numkeyselect) { - char numk[] = "1234567890"; - for(int numc = 0;numk[numc]; ++ numc) { - if (key.get_ascii_code() == numk[numc]) { - if (m_lookup_table.get_current_page_size() > numc) - select_candidate((unsigned int)numc); - return true; - } - } - } -*/ m_prediction = false; commit_string(m_convList.kouho.at(m_convList.pos).kanji); m_preeditor->reset(); @@ -1307,9 +1288,6 @@ m_lookup = false; m_convertor->reset(); m_preeditor->reset(); - //if (m_convertor->isConnected()) m_convertor->wnnDisconnect(); - //m_convertor->wnnConnect(String("scim-wnn"),host,rc,sType,0); - //updatePreEditor(); } void HonokaInstance::focus_in ()