Loading configure.ac +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ m4_define([pyzy_released], [1]) m4_define([pyzy_major_version], [0]) m4_define([pyzy_minor_version], [0]) m4_define([pyzy_micro_version], [6]) m4_define([pyzy_micro_version], [7]) m4_define([pyzy_interface_age], [0]) m4_define([pyzy_binary_age], [m4_eval(100 * pyzy_minor_version + pyzy_micro_version)]) Loading src/PyZyBopomofoContext.cc +16 −2 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ BopomofoContext::insert (char ch) return true; m_text.insert (m_cursor++, ch); updateInputText (); updateCursor (); if (G_UNLIKELY (!(m_config.option & PINYIN_INCOMPLETE_PINYIN))) { updateSpecialPhrases (); Loading @@ -80,6 +82,7 @@ BopomofoContext::insert (char ch) updateAuxiliaryText (); } } return true; } Loading @@ -91,7 +94,8 @@ BopomofoContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -105,6 +109,7 @@ BopomofoContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); Loading @@ -131,6 +136,8 @@ BopomofoContext::removeWordBefore (void) m_text.erase (cursor, m_cursor - cursor); m_cursor = cursor; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -144,6 +151,7 @@ BopomofoContext::removeWordAfter (void) return false; m_text.erase (m_cursor, -1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); return true; Loading @@ -156,6 +164,7 @@ BopomofoContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -169,7 +178,7 @@ BopomofoContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -192,6 +201,7 @@ BopomofoContext::moveCursorLeftByWord (void) m_pinyin_len -= p.len; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -215,6 +225,7 @@ BopomofoContext::moveCursorToBegin (void) m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -229,6 +240,7 @@ BopomofoContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading Loading @@ -345,6 +357,8 @@ BopomofoContext::commit (CommitType type) } resetContext (); updateInputText (); updateCursor (); update (); PhoneticContext::commitText (m_buffer); } Loading src/PyZyDoublePinyinContext.cc +21 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ DoublePinyinContext::insert (char ch) return false; } else { updateInputText (); updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -92,6 +94,8 @@ DoublePinyinContext::insert (char ch) } } else { updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -107,6 +111,8 @@ DoublePinyinContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); Loading @@ -132,6 +138,8 @@ DoublePinyinContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); if (updateSpecialPhrases ()) { update (); } Loading @@ -151,6 +159,8 @@ DoublePinyinContext::removeWordBefore (void) if (G_UNLIKELY (m_cursor > m_pinyin_len)) { m_text.erase (m_pinyin_len, m_cursor - m_pinyin_len); m_cursor = m_pinyin_len; updateInputText (); updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -164,6 +174,8 @@ DoublePinyinContext::removeWordBefore (void) m_pinyin.pop_back (); m_text.erase (m_pinyin_len, m_cursor - m_pinyin_len); m_cursor = m_pinyin_len; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -179,6 +191,8 @@ DoublePinyinContext::removeWordAfter (void) return false; m_text.erase (m_cursor); updateInputText (); if (updateSpecialPhrases ()) { update (); } Loading @@ -196,6 +210,7 @@ DoublePinyinContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); if (m_cursor >= m_pinyin_len) { if (updateSpecialPhrases ()) { Loading Loading @@ -233,6 +248,7 @@ DoublePinyinContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); updatePhraseEditor (); Loading @@ -258,6 +274,7 @@ DoublePinyinContext::moveCursorLeftByWord (void) if (G_UNLIKELY (m_cursor > m_pinyin_len)) { m_cursor = m_pinyin_len; updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -269,6 +286,7 @@ DoublePinyinContext::moveCursorLeftByWord (void) else { m_cursor = m_pinyin_len = m_pinyin.back ().begin; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -292,6 +310,7 @@ DoublePinyinContext::moveCursorToBegin (void) m_cursor = 0; m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -306,6 +325,8 @@ DoublePinyinContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); updatePhraseEditor (); Loading src/PyZyFullPinyinContext.cc +13 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ FullPinyinContext::insert (char ch) return true; m_text.insert (m_cursor++, ch); updateInputText (); updateCursor (); if (G_UNLIKELY (!(m_config.option & PINYIN_INCOMPLETE_PINYIN))) { updateSpecialPhrases (); Loading Loading @@ -78,7 +80,8 @@ FullPinyinContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -92,6 +95,7 @@ FullPinyinContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); Loading @@ -118,6 +122,8 @@ FullPinyinContext::removeWordBefore (void) m_text.erase (cursor, m_cursor - cursor); m_cursor = cursor; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -131,6 +137,7 @@ FullPinyinContext::removeWordAfter (void) return false; m_text.erase (m_cursor, -1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); return true; Loading @@ -143,6 +150,7 @@ FullPinyinContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -156,6 +164,7 @@ FullPinyinContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -178,6 +187,7 @@ FullPinyinContext::moveCursorLeftByWord (void) m_pinyin_len -= p.len; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -200,6 +210,7 @@ FullPinyinContext::moveCursorToBegin (void) m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -213,6 +224,7 @@ FullPinyinContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading src/PyZyInputContext.h +18 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public: public: virtual ~Observer () { } /** * \brief Notifies a commit text. * @param context InputContext instance which triggered this method. Loading @@ -100,6 +101,23 @@ public: virtual void commitText (const InputContext * context, const std::string &commit_text) = 0; /** * \brief Notifies input text is changed. * @param context InputContext instance which triggered this method. * * This method is triggered by InputContext when input text is * changed. */ virtual void inputTextChanged (const InputContext * context) = 0; /** * \brief Notifies cursor is changed. * @param context InputContext instance which triggered this method. * * This method is triggered by InputContext when cursor is changed. */ virtual void cursorChanged (const InputContext * context) = 0; /** * \brief Notifies preedit text is changed. * @param context InputContext instance which triggered this method. Loading Loading
configure.ac +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ m4_define([pyzy_released], [1]) m4_define([pyzy_major_version], [0]) m4_define([pyzy_minor_version], [0]) m4_define([pyzy_micro_version], [6]) m4_define([pyzy_micro_version], [7]) m4_define([pyzy_interface_age], [0]) m4_define([pyzy_binary_age], [m4_eval(100 * pyzy_minor_version + pyzy_micro_version)]) Loading
src/PyZyBopomofoContext.cc +16 −2 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ BopomofoContext::insert (char ch) return true; m_text.insert (m_cursor++, ch); updateInputText (); updateCursor (); if (G_UNLIKELY (!(m_config.option & PINYIN_INCOMPLETE_PINYIN))) { updateSpecialPhrases (); Loading @@ -80,6 +82,7 @@ BopomofoContext::insert (char ch) updateAuxiliaryText (); } } return true; } Loading @@ -91,7 +94,8 @@ BopomofoContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -105,6 +109,7 @@ BopomofoContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); Loading @@ -131,6 +136,8 @@ BopomofoContext::removeWordBefore (void) m_text.erase (cursor, m_cursor - cursor); m_cursor = cursor; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -144,6 +151,7 @@ BopomofoContext::removeWordAfter (void) return false; m_text.erase (m_cursor, -1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); return true; Loading @@ -156,6 +164,7 @@ BopomofoContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -169,7 +178,7 @@ BopomofoContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -192,6 +201,7 @@ BopomofoContext::moveCursorLeftByWord (void) m_pinyin_len -= p.len; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -215,6 +225,7 @@ BopomofoContext::moveCursorToBegin (void) m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -229,6 +240,7 @@ BopomofoContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading Loading @@ -345,6 +357,8 @@ BopomofoContext::commit (CommitType type) } resetContext (); updateInputText (); updateCursor (); update (); PhoneticContext::commitText (m_buffer); } Loading
src/PyZyDoublePinyinContext.cc +21 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ DoublePinyinContext::insert (char ch) return false; } else { updateInputText (); updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -92,6 +94,8 @@ DoublePinyinContext::insert (char ch) } } else { updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -107,6 +111,8 @@ DoublePinyinContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); Loading @@ -132,6 +138,8 @@ DoublePinyinContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); if (updateSpecialPhrases ()) { update (); } Loading @@ -151,6 +159,8 @@ DoublePinyinContext::removeWordBefore (void) if (G_UNLIKELY (m_cursor > m_pinyin_len)) { m_text.erase (m_pinyin_len, m_cursor - m_pinyin_len); m_cursor = m_pinyin_len; updateInputText (); updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -164,6 +174,8 @@ DoublePinyinContext::removeWordBefore (void) m_pinyin.pop_back (); m_text.erase (m_pinyin_len, m_cursor - m_pinyin_len); m_cursor = m_pinyin_len; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -179,6 +191,8 @@ DoublePinyinContext::removeWordAfter (void) return false; m_text.erase (m_cursor); updateInputText (); if (updateSpecialPhrases ()) { update (); } Loading @@ -196,6 +210,7 @@ DoublePinyinContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); if (m_cursor >= m_pinyin_len) { if (updateSpecialPhrases ()) { Loading Loading @@ -233,6 +248,7 @@ DoublePinyinContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); updatePhraseEditor (); Loading @@ -258,6 +274,7 @@ DoublePinyinContext::moveCursorLeftByWord (void) if (G_UNLIKELY (m_cursor > m_pinyin_len)) { m_cursor = m_pinyin_len; updateCursor (); if (updateSpecialPhrases ()) { update (); } Loading @@ -269,6 +286,7 @@ DoublePinyinContext::moveCursorLeftByWord (void) else { m_cursor = m_pinyin_len = m_pinyin.back ().begin; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -292,6 +310,7 @@ DoublePinyinContext::moveCursorToBegin (void) m_cursor = 0; m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -306,6 +325,8 @@ DoublePinyinContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); if (updatePinyin (false)) { updateSpecialPhrases (); updatePhraseEditor (); Loading
src/PyZyFullPinyinContext.cc +13 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ FullPinyinContext::insert (char ch) return true; m_text.insert (m_cursor++, ch); updateInputText (); updateCursor (); if (G_UNLIKELY (!(m_config.option & PINYIN_INCOMPLETE_PINYIN))) { updateSpecialPhrases (); Loading Loading @@ -78,7 +80,8 @@ FullPinyinContext::removeCharBefore (void) m_cursor --; m_text.erase (m_cursor, 1); updateInputText (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -92,6 +95,7 @@ FullPinyinContext::removeCharAfter (void) return false; m_text.erase (m_cursor, 1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); Loading @@ -118,6 +122,8 @@ FullPinyinContext::removeWordBefore (void) m_text.erase (cursor, m_cursor - cursor); m_cursor = cursor; updateInputText (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -131,6 +137,7 @@ FullPinyinContext::removeWordAfter (void) return false; m_text.erase (m_cursor, -1); updateInputText (); updatePreeditText (); updateAuxiliaryText (); return true; Loading @@ -143,6 +150,7 @@ FullPinyinContext::moveCursorLeft (void) return false; m_cursor --; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -156,6 +164,7 @@ FullPinyinContext::moveCursorRight (void) return false; m_cursor ++; updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading @@ -178,6 +187,7 @@ FullPinyinContext::moveCursorLeftByWord (void) m_pinyin_len -= p.len; m_pinyin.pop_back (); updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -200,6 +210,7 @@ FullPinyinContext::moveCursorToBegin (void) m_pinyin.clear (); m_pinyin_len = 0; updateCursor (); updateSpecialPhrases (); updatePhraseEditor (); update (); Loading @@ -213,6 +224,7 @@ FullPinyinContext::moveCursorToEnd (void) return false; m_cursor = m_text.length (); updateCursor (); updateSpecialPhrases (); updatePinyin (); Loading
src/PyZyInputContext.h +18 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public: public: virtual ~Observer () { } /** * \brief Notifies a commit text. * @param context InputContext instance which triggered this method. Loading @@ -100,6 +101,23 @@ public: virtual void commitText (const InputContext * context, const std::string &commit_text) = 0; /** * \brief Notifies input text is changed. * @param context InputContext instance which triggered this method. * * This method is triggered by InputContext when input text is * changed. */ virtual void inputTextChanged (const InputContext * context) = 0; /** * \brief Notifies cursor is changed. * @param context InputContext instance which triggered this method. * * This method is triggered by InputContext when cursor is changed. */ virtual void cursorChanged (const InputContext * context) = 0; /** * \brief Notifies preedit text is changed. * @param context InputContext instance which triggered this method. Loading