diff options
author | Peng Wu <alexepico@gmail.com> | 2012-07-26 12:50:06 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-07-26 12:50:06 +0800 |
commit | 88e6f403b0ed6a4eb33737c642d12b6fd462531b (patch) | |
tree | 89b92798eb3438e188ee58273a16e324fc3dd89a /src/PYPPinyinEngine.cc | |
parent | 82f7ed8fe4f108fc5408708fa3dad6b29fc15448 (diff) | |
download | ibus-libpinyin-88e6f403b0ed6a4eb33737c642d12b6fd462531b.tar.gz ibus-libpinyin-88e6f403b0ed6a4eb33737c642d12b6fd462531b.tar.xz ibus-libpinyin-88e6f403b0ed6a4eb33737c642d12b6fd462531b.zip |
enable stroke editor
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r-- | src/PYPPinyinEngine.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc index c219f09..4e5be29 100644 --- a/src/PYPPinyinEngine.cc +++ b/src/PYPPinyinEngine.cc @@ -31,6 +31,9 @@ #ifdef IBUS_BUILD_ENGLISH_INPUT_MODE #include "PYEnglishEditor.h" #endif +#ifdef IBUS_BUILD_STROKE_INPUT_MODE +#include "PYStrokeEditor.h" +#endif #include "PYPFullPinyinEditor.h" #include "PYPDoublePinyinEditor.h" #include "PYFallbackEditor.h" @@ -71,6 +74,11 @@ LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine) #else m_editors[MODE_ENGLISH].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ())); #endif +#ifdef IBUS_BUILD_STROKE_INPUT_MODE + m_editors[MODE_STROKE].reset (new StrokeEditor (m_props, LibPinyinPinyinConfig::instance ())); +#else + m_editors[MODE_STROKE].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ())); +#endif m_props.signalUpdateProperty ().connect (std::bind (&LibPinyinPinyinEngine::updateProperty, this, _1)); @@ -149,6 +157,14 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif m_input_mode = MODE_ENGLISH; break; #endif +#ifdef IBUS_BUILD_STROKE_INPUT_MODE + case IBUS_u: + // do not enable stroke mode when use double pinyin. + if (LibPinyinPinyinConfig::instance ().doublePinyin ()) + break; + m_input_mode = MODE_STROKE; + break; +#endif } } else { /* TODO: Unknown */ |