diff --git a/honoka/libhonoka/convertor.cpp b/honoka/libhonoka/convertor.cpp index ac69d56..8789efb 100644 --- a/honoka/libhonoka/convertor.cpp +++ b/honoka/libhonoka/convertor.cpp @@ -72,7 +72,7 @@ return 0; } -ResultList Convertor::getResultList(int p,int kt){ +ResultList Convertor::getResultList(int p,ResultType kt){ // ����ʸ��p���Ф���kt�ȸ����Ѵ���ˡ���Ѵ����� // �Ѵ���̤θ���򤹤٤�ResultList��������֤��Ʋ������� // ����/���顼�����ϸ���̵����ResultList���֤����ɤ��Ǥ��� diff --git a/honoka/libhonoka/convertor.h b/honoka/libhonoka/convertor.h index 059da0e..b322fee 100644 --- a/honoka/libhonoka/convertor.h +++ b/honoka/libhonoka/convertor.h @@ -52,7 +52,7 @@ virtual WideString getText(); virtual int setPos(int p); virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,int kt = 0); + virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); virtual bool select(int p); virtual AttributeList getAttributeList(); virtual bool resizeRegion(int w); diff --git a/honoka/libhonoka/resultlist.cpp b/honoka/libhonoka/resultlist.cpp index b996b18..b86e623 100644 --- a/honoka/libhonoka/resultlist.cpp +++ b/honoka/libhonoka/resultlist.cpp @@ -29,7 +29,7 @@ ResultList::ResultList() { pos = 0; - kType = 0; + kType = DEFAULT; } int ResultList::count() diff --git a/honoka/libhonoka/resultlist.h b/honoka/libhonoka/resultlist.h index 0b27236..ed9cd53 100644 --- a/honoka/libhonoka/resultlist.h +++ b/honoka/libhonoka/resultlist.h @@ -36,6 +36,9 @@ /** @author TAM (Teppei Tamra) */ + +enum ResultType { DEFAULT,PREDICTION,SPECIAL1,SPECIAL2,SPECIAL3,SPECIAL4 }; + class ResultEntry { public: ResultEntry(WideString k = WideString(),WideString l = WideString()); @@ -50,7 +53,7 @@ WideString Title; int pos; int count(); - int kType; + ResultType kType; vector kouho; }; diff --git a/honoka/plugins/anthyconversion.cpp b/honoka/plugins/anthyconversion.cpp index e26b31d..e346419 100644 --- a/honoka/plugins/anthyconversion.cpp +++ b/honoka/plugins/anthyconversion.cpp @@ -97,10 +97,10 @@ return pos; } -ResultList AnthyConversion::getResultList(int p,int kt){ +ResultList AnthyConversion::getResultList(int p,ResultType kt){ if (p == -1) p = pos; if (p >= convResult.size()) return ResultList(); - if ((kt != 0) || (p >= convResult.size())) return ResultList(); + if ((kt != DEFAULT) || (p >= convResult.size())) return ResultList(); setPos(p); return convResult[p]; } @@ -163,7 +163,7 @@ convResult.clear(); for(int i = 0;i < stat.nr_segment;i ++) { ResultList l; - l.kType = 0; + l.kType = DEFAULT; l.Title = utf8_mbstowcs(String(_("lookup result"))); struct anthy_segment_stat sstat; anthy_get_segment_stat(context,i,&sstat); diff --git a/honoka/plugins/anthyconversion.h b/honoka/plugins/anthyconversion.h index 5fe04d7..bf6fc3d 100644 --- a/honoka/plugins/anthyconversion.h +++ b/honoka/plugins/anthyconversion.h @@ -49,7 +49,7 @@ virtual WideString getText(); virtual int setPos(int p); virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,int kt = 0); + virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); virtual bool select(int p); virtual AttributeList getAttributeList(); virtual bool resizeRegion(int w); diff --git a/honoka/plugins/simpleprediction.cpp b/honoka/plugins/simpleprediction.cpp index 3935b18..c9f2571 100644 --- a/honoka/plugins/simpleprediction.cpp +++ b/honoka/plugins/simpleprediction.cpp @@ -64,8 +64,7 @@ } if (!tmp.size()) return ResultList(); ResultList l; - l.kType = 3; - //for(unsigned int i = 0;i < tmp.size();i ++) { + l.kType = PREDICTION; for(multimap::iterator it = tmp.begin();it != tmp.end();it ++) { l.kouho.push_back(ResultEntry(it->second)); } diff --git a/honoka/plugins/skkdicconversion.cpp b/honoka/plugins/skkdicconversion.cpp index 8d5409c..41c6013 100644 --- a/honoka/plugins/skkdicconversion.cpp +++ b/honoka/plugins/skkdicconversion.cpp @@ -97,13 +97,13 @@ return pos; } -ResultList SKKDicConversion::getResultList(int p,int kt){ +ResultList SKKDicConversion::getResultList(int p,ResultType kt){ list.Yomi.clear(); list.kouho.clear(); list.Title = utf8_mbstowcs(String(_("lookup result"))); //list.count = 0; ResultEntry e; - if (kt != 0) return list; + if (kt != DEFAULT) return list; if (p == -1) p = pos; else if (setPos(p) != p) return list; e.kanji = buns[pos]; diff --git a/honoka/plugins/skkdicconversion.h b/honoka/plugins/skkdicconversion.h index d4c26ef..70cd6bf 100644 --- a/honoka/plugins/skkdicconversion.h +++ b/honoka/plugins/skkdicconversion.h @@ -52,7 +52,7 @@ virtual WideString getText(); virtual int setPos(int p); virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,int kt = 0); + virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); virtual bool select(int p); virtual AttributeList getAttributeList(); virtual bool resizeRegion(int w); diff --git a/honoka/plugins/wnnconversion.cpp b/honoka/plugins/wnnconversion.cpp index 0b39667..585ae06 100644 --- a/honoka/plugins/wnnconversion.cpp +++ b/honoka/plugins/wnnconversion.cpp @@ -349,7 +349,7 @@ convList.kouho.clear(); //convList.count = 0; convList.pos = 0; - convList.kType = YOSOKU; + convList.kType = PREDICTION; convList.Title = utf8_mbstowcs(String(_("yosoku lookup result"))); #ifdef HAVE_LIBWNN7 String s; @@ -371,9 +371,9 @@ /*! - \fn WnnConversion::getResultList(int p,int kt) + \fn WnnConversion::getResultList(int p,ResultType kt) */ -ResultList WnnConversion::getResultList(int p,int kt) +ResultList WnnConversion::getResultList(int p,ResultType kt) { w_char k[1024]; char buf[2048]; @@ -400,15 +400,15 @@ else if (pos == (bunsetu - 1)) conn = WNN_USE_MAE; switch (kt) { #ifdef HAVE_LIBWNN7 - case IKEIJI: { + case SPECIAL2: { convList.pos = jl_zenikeiji_dai(wnn,pos,pos + 1,conn,WNN_UNIQ); - convList.kType = IKEIJI; + convList.kType = SPECIAL2; convList.Title = utf8_mbstowcs(String(_("Ikeiji lookup result"))); break; } - case RENSOU: { + case SPECIAL1: { convList.pos = jl_zenassoc_dai(wnn,pos,pos + 1,conn,WNN_UNIQ); - convList.kType = RENSOU; + convList.kType = SPECIAL1; convList.Title = utf8_mbstowcs(String(_("association lookup result"))); break; } @@ -454,7 +454,7 @@ jl_set_jikouho_dai(wnn,p); break; } - case YOSOKU: { + case PREDICTION: { #ifdef HAVE_LIBWNN7 jl_yosoku_selected_cand(wnn,p); #endif diff --git a/honoka/plugins/wnnconversion.h b/honoka/plugins/wnnconversion.h index c80ecc6..afc1922 100644 --- a/honoka/plugins/wnnconversion.h +++ b/honoka/plugins/wnnconversion.h @@ -46,10 +46,6 @@ */ enum JServerType { Wnn4, Wnn6, Wnn7, Wnn8 }; -#define DEFAULT 0 -#define IKEIJI 1 -#define RENSOU 2 -#define YOSOKU 3 class WnnConversion : public Convertor { @@ -64,7 +60,7 @@ virtual WideString getText(); virtual int setPos(int p); virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,int kt = DEFAULT); + virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); ResultList getYosokuList(const WideString &str); virtual bool select(int p); virtual AttributeList getAttributeList(); diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 1c70f01..9cfc180 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -52,10 +52,6 @@ #endif -#define DEFAULT 0 -#define IKEIJI 1 -#define RENSOU 2 -#define YOSOKU 3 static Pointer _honoka_factory; @@ -702,7 +698,7 @@ return true; } else if (k_select_yosoku.comp(key) && prediction) { - if ((m_convList.kType == YOSOKU) && (m_convList.count())) { + if ((m_convList.kType == PREDICTION) && (m_convList.count())) { return process_yosoku_key_event(key); } } @@ -871,7 +867,7 @@ return true; } else if (k_conversion_rensou.comp(key)) { - m_convList = m_convertor->getResultList(m_convertor->getPos(),RENSOU); + m_convList = m_convertor->getResultList(m_convertor->getPos(),SPECIAL1); if (m_convList.count() == 0) return true; startLookup(); updateConversion(); @@ -879,7 +875,7 @@ return true; } else if (k_conversion_ikeiji.comp(key)) { - m_convList = m_convertor->getResultList(m_convertor->getPos(),IKEIJI); + m_convList = m_convertor->getResultList(m_convertor->getPos(),SPECIAL2); if (m_convList.count() == 0) return true; startLookup(); updateConversion(); @@ -1082,7 +1078,7 @@ int p = m_lookup_table.get_current_page_start() + item; m_convList.pos = p; m_convertor->select(m_convList.pos); - if (m_convList.kType != YOSOKU) { + if (m_convList.kType != PREDICTION) { update_preedit_string(m_convertor->getText(),m_convertor->getAttributeList()); update_preedit_caret(m_convertor->getCaretPos()); } else { diff --git a/honoka/src/multiconvertor.cpp b/honoka/src/multiconvertor.cpp index 664a498..651afeb 100644 --- a/honoka/src/multiconvertor.cpp +++ b/honoka/src/multiconvertor.cpp @@ -93,7 +93,7 @@ return instance->m_def_convertor->getPos(); } -ResultList MultiConvertor::getResultList(int p,int kt){ +ResultList MultiConvertor::getResultList(int p,ResultType kt){ results.clear(); result.kouho.clear(); ResultList l = instance->m_def_convertor->getResultList(p,kt); @@ -124,9 +124,6 @@ return l; } -ResultList MultiConvertor::getYosokuList(const WideString &str) { - return ResultList(); -} bool MultiConvertor::select(int p) { if (p < result.kouho.size()) texts[getPos()] = result.kouho[p].kanji; diff --git a/honoka/src/multiconvertor.h b/honoka/src/multiconvertor.h index 5127829..311aac8 100644 --- a/honoka/src/multiconvertor.h +++ b/honoka/src/multiconvertor.h @@ -50,8 +50,7 @@ virtual WideString getText(); virtual int setPos(int p); virtual int getPos(); - virtual ResultList getResultList(int p = -1 ,int kt = 0); - virtual ResultList getYosokuList(const WideString &str); + virtual ResultList getResultList(int p = -1 ,ResultType kt = DEFAULT); virtual bool select(int p); virtual AttributeList getAttributeList(); virtual bool resizeRegion(int w);