re-factor pinyin editor
authorPeng Wu <alexepico@gmail.com>
Wed, 28 Sep 2011 09:35:18 +0000 (17:35 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 22 Dec 2011 04:23:13 +0000 (12:23 +0800)
src/PYPPinyinEditor.cc
src/PYPPinyinEditor.h

index 5599416..817f621 100644 (file)
@@ -298,34 +298,7 @@ LibPinyinPinyinEditor::updateLookupTable ()
     LibPinyinPhoneticEditor::updateLookupTable ();
 }
 
-gboolean
-LibPinyinPinyinEditor::removeCharBefore (void)
-{
-    if (G_UNLIKELY (m_cursor == 0))
-        return FALSE;
-
-    m_cursor --;
-    m_text.erase (m_cursor, 1);
-
-    updatePinyin ();
-    update ();
-
-    return TRUE;
-}
-
-gboolean
-LibPinyinPinyinEditor::removeCharAfter (void)
-{
-    if (G_UNLIKELY (m_cursor == m_text.length ()))
-        return FALSE;
-
-    m_text.erase (m_cursor, 1);
-
-    updatePinyin ();
-    update ();
-
-    return TRUE;
-}
+/* move cursor functions */
 
 guint
 LibPinyinPinyinEditor::getCursorLeftByWord (void)
@@ -398,28 +371,6 @@ LibPinyinPinyinEditor::removeWordAfter (void)
 }
 
 gboolean
-LibPinyinPinyinEditor::moveCursorLeft (void)
-{
-    if (G_UNLIKELY (m_cursor == 0))
-        return FALSE;
-
-    m_cursor --;
-    update ();
-    return TRUE;
-}
-
-gboolean
-LibPinyinPinyinEditor::moveCursorRight (void)
-{
-    if (G_UNLIKELY (m_cursor == m_text.length ()))
-        return FALSE;
-
-    m_cursor ++;
-    update ();
-    return TRUE;
-}
-
-gboolean
 LibPinyinPinyinEditor::moveCursorLeftByWord (void)
 {
     if (G_UNLIKELY (m_cursor == 0))
@@ -444,25 +395,3 @@ LibPinyinPinyinEditor::moveCursorRightByWord (void)
     update ();
     return TRUE;
 }
-
-gboolean
-LibPinyinPinyinEditor::moveCursorToBegin (void)
-{
-    if (G_UNLIKELY (m_cursor == 0))
-        return TRUE;
-
-    m_cursor = 0;
-    update ();
-    return TRUE;
-}
-
-gboolean
-LibPinyinPinyinEditor::moveCursorToEnd (void)
-{
-    if (G_UNLIKELY (m_cursor == m_text.length ()))
-        return FALSE;
-
-    m_cursor = m_text.length ();
-    update ();
-    return TRUE;
-}
index 974d2a5..87fe210 100644 (file)
@@ -36,17 +36,11 @@ public:
     LibPinyinPinyinEditor (PinyinProperties & props, Config & config);
 
 public:
-    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);
 
 
 protected: