diff options
author | Peng Wu <alexepico@gmail.com> | 2018-10-31 13:18:22 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2018-10-31 13:18:22 +0800 |
commit | 0401ff95be8f8b906d7a79feded7482c4172b28f (patch) | |
tree | 3492205b93ab05e53b3fcd20c3f7b24f639283c1 /src/PYPPinyinEngine.cc | |
parent | 17ec73fad0f05cb23c2213ddc0ec2b798bbe6ab3 (diff) | |
download | ibus-libpinyin-0401ff95be8f8b906d7a79feded7482c4172b28f.tar.gz ibus-libpinyin-0401ff95be8f8b906d7a79feded7482c4172b28f.tar.xz ibus-libpinyin-0401ff95be8f8b906d7a79feded7482c4172b28f.zip |
fixes lua build1.10.92
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r-- | src/PYPPinyinEngine.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc index 0c71ca3..efb518e 100644 --- a/src/PYPPinyinEngine.cc +++ b/src/PYPPinyinEngine.cc @@ -53,7 +53,9 @@ PinyinEngine::PinyinEngine (IBusEngine *engine) { gint i; +#ifdef IBUS_BUILD_LUA_EXTENSION initLuaPlugin (); +#endif m_double_pinyin = PinyinConfig::instance ().doublePinyin (); @@ -61,12 +63,16 @@ PinyinEngine::PinyinEngine (IBusEngine *engine) DoublePinyinEditor *editor = new DoublePinyinEditor (m_props, PinyinConfig::instance ()); m_editors[MODE_INIT].reset (editor); +#ifdef IBUS_BUILD_LUA_EXTENSION editor->setLuaPlugin (m_lua_plugin); +#endif } else { FullPinyinEditor *editor = new FullPinyinEditor (m_props, PinyinConfig::instance ()); m_editors[MODE_INIT].reset (editor); +#ifdef IBUS_BUILD_LUA_EXTENSION editor->setLuaPlugin (m_lua_plugin); +#endif } m_editors[MODE_PUNCT].reset @@ -98,7 +104,9 @@ PinyinEngine::PinyinEngine (IBusEngine *engine) SuggestionEditor *editor = new SuggestionEditor (m_props, PinyinConfig::instance ()); m_editors[MODE_SUGGESTION].reset (editor); +#ifdef IBUS_BUILD_LUA_EXTENSION editor->setLuaPlugin (m_lua_plugin); +#endif } m_props.signalUpdateProperty ().connect @@ -116,6 +124,7 @@ PinyinEngine::~PinyinEngine (void) { } +#ifdef IBUS_BUILD_LUA_EXTENSION gboolean PinyinEngine::initLuaPlugin (void) { @@ -137,6 +146,7 @@ PinyinEngine::loadLuaScript (const char * filename) { return !ibus_engine_plugin_load_lua_script (m_lua_plugin, filename); } +#endif /* keep synced with bopomofo engine. */ gboolean @@ -335,7 +345,9 @@ PinyinEngine::focusIn (void) DoublePinyinEditor *editor = new DoublePinyinEditor (m_props, PinyinConfig::instance ()); m_editors[MODE_INIT].reset (editor); +#ifdef IBUS_BUILD_LUA_EXTENSION editor->setLuaPlugin (m_lua_plugin); +#endif connectEditorSignals (m_editors[MODE_INIT]); } m_double_pinyin = TRUE; @@ -345,7 +357,9 @@ PinyinEngine::focusIn (void) FullPinyinEditor *editor = new FullPinyinEditor (m_props, PinyinConfig::instance ()); m_editors[MODE_INIT].reset (editor); +#ifdef IBUS_BUILD_LUA_EXTENSION editor->setLuaPlugin (m_lua_plugin); +#endif connectEditorSignals (m_editors[MODE_INIT]); } m_double_pinyin = FALSE; |