diff --git a/honoka/src/honoka_def.h b/honoka/src/honoka_def.h index 795ba71..83de1f7 100644 --- a/honoka/src/honoka_def.h +++ b/honoka/src/honoka_def.h @@ -81,11 +81,15 @@ #define HONOKA_DEFAULT_KEY_SELECT_PREDICTION "Tab" #define HONOKA_CONFIG_KEY_AUTO_CONVERSION "/IMEngine/Honoka/Key/AutoConversion" #define HONOKA_DEFAULT_KEY_AUTO_CONVERSION "Alt+a" -#define HONOKA_CONFIG_KEY_RECONVERSION "/IMEngine/Honoka/ReConversion" +#define HONOKA_CONFIG_KEY_RECONVERSION "/IMEngine/Honoka/Key/ReConversion" #define HONOKA_DEFAULT_KEY_RECONVERSION "Alt+space" -#define HONOKA_CONFIG_KEY_RESULTTOPREEDIT "/IMEngine/Honoka/SetResultToPreEditor" +#define HONOKA_CONFIG_KEY_RESULTTOPREEDIT "/IMEngine/Honoka/Key/SetResultToPreEditor" #define HONOKA_DEFAULT_KEY_RESULTTOPREEDIT "Control+Return" +#define HONOKA_CONFIG_KEY_CONVERTOR_PREFIX "/IMEngine/Honoka/Key/Convertor" +#define HONOKA_CONFIG_KEY_PREEDITOR_PREFIX "/IMEngine/Honoka/Key/PreEditor" +#define HONOKA_CONFIG_KEY_PREDICTOR_PREFIX "/IMEngine/Honoka/Key/Predictor" + #define HONOKA_CONFIG_ALP "/IMEngine/Honoka/AutoLookupPopup" #define HONOKA_DEFAULT_ALP 3 diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index fe88836..51396a6 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -429,6 +429,24 @@ sl = split(defaultPredictor); for(unsigned int i = 0;i < sl.size();i ++) if (changePredictor(sl[i])) break; + for(unsigned int i = 0;i < convertors.size();i ++) { + HonokaKeyEventList k; + scim_string_to_key_list(k, + _scim_config->read(String(HONOKA_CONFIG_KEY_CONVERTOR_PREFIX) + String("/") + convertors[i]->getName(),String(""))); + k_convertor.push_back(k); + } + for(unsigned int i = 0;i < preeditors.size();i ++) { + HonokaKeyEventList k; + scim_string_to_key_list(k, + _scim_config->read(String(HONOKA_CONFIG_KEY_PREEDITOR_PREFIX) + String("/") + preeditors[i]->getName(),String(""))); + k_preeditor.push_back(k); + } + for(unsigned int i = 0;i < predictors.size();i ++) { + HonokaKeyEventList k; + scim_string_to_key_list(k, + _scim_config->read(String(HONOKA_CONFIG_KEY_PREDICTOR_PREFIX) + String("/") + predictors[i]->getName(),String(""))); + k_predictor.push_back(k); + } } @@ -440,8 +458,17 @@ const WideString HonokaInstance::getConvertedText() { vector seglist = m_convertor->getSegmentList(); - segments = seglist; + vector newsegs; + //segments = seglist; WideString t; + for(unsigned int i = 0;i < seglist.size();i ++) { + if (i < m_convertor->getPos()) { + if (seglist[i].getKanji() != segments[i].getKanji()) + newsegs.push_back(segments[i]); + else newsegs.push_back(seglist[i]); + } else newsegs.push_back(seglist[i]); + } + segments = newsegs; for(unsigned int i = 0;i < segments.size();i ++) { t += segments[i].getKanji(); } diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index 19ac726..05ea9c6 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -195,6 +195,9 @@ k_select_prediction, // ͽ¬���� k_selection[9], // �������򥷥硼�ȥ��å� k_dummy; + vector k_convertor; + vector k_preeditor; + vector k_predictor; }; diff --git a/honoka/src/multiconvertor.h b/honoka/src/multiconvertor.h index 847b700..38ae642 100644 --- a/honoka/src/multiconvertor.h +++ b/honoka/src/multiconvertor.h @@ -59,6 +59,7 @@ virtual String getName(); virtual String getPropertyName(); virtual const vector getSegmentList(); + static void aline(Convertor *master,Convertor *slave); protected: HonokaInstance *instance;