diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/PYPEnglishCandidates.cc | 2 | ||||
-rw-r--r-- | src/PYPPhoneticEditor.cc | 18 | ||||
-rw-r--r-- | src/PYPPhoneticEditor.h | 8 |
3 files changed, 27 insertions, 1 deletions
diff --git a/src/PYPEnglishCandidates.cc b/src/PYPEnglishCandidates.cc index 614fecd..caf2185 100644 --- a/src/PYPEnglishCandidates.cc +++ b/src/PYPEnglishCandidates.cc @@ -24,7 +24,7 @@ using namespace PY; -static const int MINIMAL_ENGLISH_CHARACTERS = 3; +static const int MINIMAL_ENGLISH_CHARACTERS = 4; static const int MAXIMAL_ENGLISH_CANDIDATES = 2; EnglishCandidates::EnglishCandidates (Editor *editor) diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index b6ceb69..a7f74d8 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -40,6 +40,9 @@ PhoneticEditor::PhoneticEditor (PinyinProperties &props, #ifdef ENABLE_CLOUD_INPUT_MODE m_cloud_candidates(this), #endif +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE + m_english_candidates (this), +#endif m_traditional_candidates (this, config) { } @@ -251,6 +254,11 @@ PhoneticEditor::updateCandidates (void) if (!m_props.modeSimp ()) m_traditional_candidates.processCandidates (m_candidates); +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE + if (m_config.englishInputMode ()) + m_english_candidates.processCandidates (m_candidates); +#endif + return TRUE; } @@ -376,6 +384,11 @@ PhoneticEditor::selectCandidateInternal (EnhancedCandidate & candidate) case CANDIDATE_TRADITIONAL_CHINESE: return m_traditional_candidates.selectCandidate (candidate); +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE + case CANDIDATE_ENGLISH: + return m_english_candidates.selectCandidate (candidate); +#endif + #ifdef ENABLE_CLOUD_INPUT_MODE case CANDIDATE_CLOUD_INPUT: return m_cloud_candidates.selectCandidate (candidate); @@ -409,6 +422,11 @@ PhoneticEditor::removeCandidateInternal (EnhancedCandidate & candidate) case CANDIDATE_TRADITIONAL_CHINESE: return m_traditional_candidates.removeCandidate (candidate); +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE + case CANDIDATE_ENGLISH: + return m_english_candidates.removeCandidate (candidate); +#endif + #ifdef IBUS_BUILD_LUA_EXTENSION case CANDIDATE_LUA_TRIGGER: return m_lua_trigger_candidates.removeCandidate (candidate); diff --git a/src/PYPPhoneticEditor.h b/src/PYPPhoneticEditor.h index ecc9eb7..e317e7b 100644 --- a/src/PYPPhoneticEditor.h +++ b/src/PYPPhoneticEditor.h @@ -32,6 +32,10 @@ #include "PYPLibPinyinCandidates.h" #include "PYPTradCandidates.h" +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE +#include "PYPEnglishCandidates.h" +#endif + #ifdef IBUS_BUILD_LUA_EXTENSION #include "PYPLuaTriggerCandidates.h" #include "PYPLuaConverterCandidates.h" @@ -131,6 +135,10 @@ protected: TraditionalCandidates m_traditional_candidates; +#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE + EnglishCandidates m_english_candidates; +#endif + #ifdef ENABLE_CLOUD_INPUT_MODE CloudCandidates m_cloud_candidates; #endif |