return LibPinyinPinyinEditor::processKeyEvent (keyval, keycode, modifiers);
}
+
+void
+LibPinyinDoublePinyinEditor::updatePinyin (void)
+{
+ if (G_UNLIKELY (m_text.empty ())) {
+ m_pinyins.clear ();
+ m_pinyin_len = 0;
+ /* TODO: check whether to replace "" with NULL. */
+ pinyin_parse_more_double_pinyins (m_instance, "");
+ return;
+ }
+
+ m_pinyin_len =
+ pinyin_parse_more_double_pinyins (m_instance, m_text.c_str ());
+ pinyin_guess_sentence (m_instance);
+}
gboolean insert (gint ch);
- gboolean removeCharBefore (void);
- gboolean removeCharAfter (void);
- gboolean removeWordBefore (void);
- gboolean removeWordAfter (void);
-
- gboolean moveCursorLeft (void);
- gboolean moveCursorRight (void);
- gboolean moveCursorLeftByWord (void);
- gboolean moveCursorRightByWord (void);
- gboolean moveCursorToBegin (void);
- gboolean moveCursorToEnd (void);
-
/* override virtual functions */
gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
void reset (void);
if (G_UNLIKELY (m_text.empty ())) {
m_pinyins.clear ();
m_pinyin_len = 0;
+ /* TODO: check whether to replace "" with NULL. */
+ pinyin_parse_more_full_pinyins (m_instance, "");
return;
}
PinyinSegment py = *iter;
pinyin_parse_full_pinyin (m_instance, py.pinyin->text, &key);
pos.set_pos (py.begin); pos.set_length (py.len);
- g_array_append_val(m_instance->m_pinyin_keys, key);
- g_array_append_val(m_instance->m_pinyin_poses, pos);
+ g_array_append_val (m_instance->m_pinyin_keys, key);
+ g_array_append_val (m_instance->m_pinyin_poses, pos);
}
- pinyin_guess_sentence(m_instance);
+ pinyin_guess_sentence (m_instance);
}
void