Loading src/PyZyBopomofoContext.cc +5 −5 Original line number Diff line number Diff line Loading @@ -310,7 +310,7 @@ BopomofoContext::updateAuxiliaryText (void) if (G_UNLIKELY (m_text.empty () || m_phrase_editor.candidates ().size () == 0)) { m_auxiliary_text = ""; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); return; } Loading Loading @@ -349,7 +349,7 @@ BopomofoContext::updateAuxiliaryText (void) } m_auxiliary_text = m_buffer; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); } void Loading Loading @@ -384,7 +384,7 @@ BopomofoContext::commit () m_phrase_editor.commit (); reset (); update (); m_observer->commitText (this, m_buffer); PhoneticContext::commitText (m_buffer); } void Loading @@ -393,7 +393,7 @@ BopomofoContext::updatePreeditText (void) /* preedit text = selected phrases + highlight candidate + rest text */ if (G_UNLIKELY (m_phrase_editor.empty () && m_text.empty ())) { m_preedit_text.clear (); m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); return; } Loading Loading @@ -474,7 +474,7 @@ BopomofoContext::updatePreeditText (void) m_preedit_text.rest_text = m_buffer.substr (edit_end_byte); } m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); } static gint Loading src/PyZyPhoneticContext.cc +18 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,12 @@ PhoneticContext::updateSpecialPhrases (void) return size != m_special_phrases.size () || size != 0; } void PhoneticContext::commitText (const std::string & commit_text) { m_observer->commitText (this, commit_text); } void PhoneticContext::updateLookupTable (void) { Loading Loading @@ -203,6 +209,18 @@ PhoneticContext::updateLookupTable (void) m_observer->lookupTableChanged (this); } void PhoneticContext::updateAuxiliaryText (void) { m_observer->auxiliaryTextChanged (this); } void PhoneticContext::updatePreeditText (void) { m_observer->preeditTextChanged (this); } void PhoneticContext::reset (void) { Loading src/PyZyPhoneticContext.h +8 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,11 @@ public: protected: virtual void commitText (const std::string & commit_text); virtual void updateLookupTable (void); virtual void updateAuxiliaryText (void); virtual void updatePreeditText (void); virtual gboolean updateSpecialPhrases (void); gboolean selectCandidate (guint i); gboolean selectCandidateInPage (guint i); Loading Loading @@ -107,6 +111,7 @@ protected: return (const gchar *)m_text + m_cursor; } /* pure virtual functions */ virtual gboolean insert (gint ch) = 0; virtual gboolean removeCharBefore (void) = 0; Loading @@ -119,8 +124,6 @@ protected: virtual gboolean moveCursorRightByWord (void) = 0; virtual gboolean moveCursorToBegin (void) = 0; virtual gboolean moveCursorToEnd (void) = 0; virtual void updateAuxiliaryText (void) = 0; virtual void updatePreeditText (void) = 0; /* variables */ Config &m_config; Loading @@ -134,9 +137,11 @@ protected: std::string m_selected_special_phrase; String m_text; Preedit m_preedit_text; PhoneticContext::Observer *m_observer; std::vector<Candidate> m_candidates; std::string m_auxiliary_text; private: PhoneticContext::Observer *m_observer; }; }; // namespace PyZy Loading src/PyZyPinyinContext.cc +5 −5 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ PinyinContext::commit () m_phrase_editor.commit (); reset (); update (); m_observer->commitText (this, m_buffer); PhoneticContext::commitText (m_buffer); } void Loading @@ -71,7 +71,7 @@ PinyinContext::updatePreeditText () /* preedit text = selected phrases + highlight candidate + rest text */ if (G_UNLIKELY (m_phrase_editor.empty () && m_text.empty ())) { m_preedit_text.clear (); m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); return; } Loading Loading @@ -148,7 +148,7 @@ PinyinContext::updatePreeditText () m_preedit_text.rest_text = m_buffer.substr (edit_end_byte); } m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); } void Loading @@ -158,7 +158,7 @@ PinyinContext::updateAuxiliaryText (void) if (G_UNLIKELY (m_text.empty () || m_candidates.size () == 0)) { m_auxiliary_text = ""; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); return; } Loading Loading @@ -201,7 +201,7 @@ PinyinContext::updateAuxiliaryText (void) } m_auxiliary_text = m_buffer; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); } }; // namespace PyZy Loading
src/PyZyBopomofoContext.cc +5 −5 Original line number Diff line number Diff line Loading @@ -310,7 +310,7 @@ BopomofoContext::updateAuxiliaryText (void) if (G_UNLIKELY (m_text.empty () || m_phrase_editor.candidates ().size () == 0)) { m_auxiliary_text = ""; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); return; } Loading Loading @@ -349,7 +349,7 @@ BopomofoContext::updateAuxiliaryText (void) } m_auxiliary_text = m_buffer; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); } void Loading Loading @@ -384,7 +384,7 @@ BopomofoContext::commit () m_phrase_editor.commit (); reset (); update (); m_observer->commitText (this, m_buffer); PhoneticContext::commitText (m_buffer); } void Loading @@ -393,7 +393,7 @@ BopomofoContext::updatePreeditText (void) /* preedit text = selected phrases + highlight candidate + rest text */ if (G_UNLIKELY (m_phrase_editor.empty () && m_text.empty ())) { m_preedit_text.clear (); m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); return; } Loading Loading @@ -474,7 +474,7 @@ BopomofoContext::updatePreeditText (void) m_preedit_text.rest_text = m_buffer.substr (edit_end_byte); } m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); } static gint Loading
src/PyZyPhoneticContext.cc +18 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,12 @@ PhoneticContext::updateSpecialPhrases (void) return size != m_special_phrases.size () || size != 0; } void PhoneticContext::commitText (const std::string & commit_text) { m_observer->commitText (this, commit_text); } void PhoneticContext::updateLookupTable (void) { Loading Loading @@ -203,6 +209,18 @@ PhoneticContext::updateLookupTable (void) m_observer->lookupTableChanged (this); } void PhoneticContext::updateAuxiliaryText (void) { m_observer->auxiliaryTextChanged (this); } void PhoneticContext::updatePreeditText (void) { m_observer->preeditTextChanged (this); } void PhoneticContext::reset (void) { Loading
src/PyZyPhoneticContext.h +8 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,11 @@ public: protected: virtual void commitText (const std::string & commit_text); virtual void updateLookupTable (void); virtual void updateAuxiliaryText (void); virtual void updatePreeditText (void); virtual gboolean updateSpecialPhrases (void); gboolean selectCandidate (guint i); gboolean selectCandidateInPage (guint i); Loading Loading @@ -107,6 +111,7 @@ protected: return (const gchar *)m_text + m_cursor; } /* pure virtual functions */ virtual gboolean insert (gint ch) = 0; virtual gboolean removeCharBefore (void) = 0; Loading @@ -119,8 +124,6 @@ protected: virtual gboolean moveCursorRightByWord (void) = 0; virtual gboolean moveCursorToBegin (void) = 0; virtual gboolean moveCursorToEnd (void) = 0; virtual void updateAuxiliaryText (void) = 0; virtual void updatePreeditText (void) = 0; /* variables */ Config &m_config; Loading @@ -134,9 +137,11 @@ protected: std::string m_selected_special_phrase; String m_text; Preedit m_preedit_text; PhoneticContext::Observer *m_observer; std::vector<Candidate> m_candidates; std::string m_auxiliary_text; private: PhoneticContext::Observer *m_observer; }; }; // namespace PyZy Loading
src/PyZyPinyinContext.cc +5 −5 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ PinyinContext::commit () m_phrase_editor.commit (); reset (); update (); m_observer->commitText (this, m_buffer); PhoneticContext::commitText (m_buffer); } void Loading @@ -71,7 +71,7 @@ PinyinContext::updatePreeditText () /* preedit text = selected phrases + highlight candidate + rest text */ if (G_UNLIKELY (m_phrase_editor.empty () && m_text.empty ())) { m_preedit_text.clear (); m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); return; } Loading Loading @@ -148,7 +148,7 @@ PinyinContext::updatePreeditText () m_preedit_text.rest_text = m_buffer.substr (edit_end_byte); } m_observer->preeditTextChanged (this); PhoneticContext::updatePreeditText (); } void Loading @@ -158,7 +158,7 @@ PinyinContext::updateAuxiliaryText (void) if (G_UNLIKELY (m_text.empty () || m_candidates.size () == 0)) { m_auxiliary_text = ""; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); return; } Loading Loading @@ -201,7 +201,7 @@ PinyinContext::updateAuxiliaryText (void) } m_auxiliary_text = m_buffer; m_observer->auxiliaryTextChanged (this); PhoneticContext::updateAuxiliaryText (); } }; // namespace PyZy