Remove slots in Engines.
authorPeng Huang <shawn.p.huang@gmail.com>
Wed, 19 May 2010 14:04:47 +0000 (22:04 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Wed, 19 May 2010 14:04:47 +0000 (22:04 +0800)
src/BopomofoEngine.cc
src/BopomofoEngine.h
src/PinyinEngine.cc
src/PinyinEngine.h

index 6d827a0..83858ff 100644 (file)
@@ -35,7 +35,7 @@ BopomofoEngine::BopomofoEngine (IBusEngine *engine)
     m_editors[MODE_RAW].reset (new RawEditor (m_props));
     m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props));
 
-    m_props.signalUpdateProperty ().connect (bind (&BopomofoEngine::slotUpdateProperty, this, _1));
+    m_props.signalUpdateProperty ().connect (bind (&BopomofoEngine::updateProperty, this, _1));
 
     for (i = MODE_INIT; i < MODE_LAST; i++) {
         connectEditorSignals (m_editors[i]);
@@ -160,9 +160,9 @@ BopomofoEngine::candidateClicked (guint index, guint button, guint state)
 }
 
 void
-BopomofoEngine::slotCommitText (Text & text)
+BopomofoEngine::commitText (Text & text)
 {
-    commitText (text);
+    Engine::commitText (text);
     if (m_input_mode != MODE_INIT)
         m_input_mode = MODE_INIT;
     if (text.text ())
@@ -172,99 +172,33 @@ BopomofoEngine::slotCommitText (Text & text)
 }
 
 void
-BopomofoEngine::slotUpdatePreeditText (Text & text, guint cursor, gboolean visible)
-{
-    updatePreeditText (text, cursor, visible);
-}
-
-void
-BopomofoEngine::slotShowPreeditText (void)
-{
-    showPreeditText ();
-}
-
-void
-BopomofoEngine::slotHidePreeditText (void)
-{
-    hidePreeditText ();
-}
-
-void
-BopomofoEngine::slotUpdateAuxiliaryText (Text & text, gboolean visible)
-{
-    updateAuxiliaryText (text, visible);
-}
-
-void
-BopomofoEngine::slotShowAuxiliaryText (void)
-{
-    showAuxiliaryText ();
-}
-
-void
-BopomofoEngine::slotHideAuxiliaryText (void)
-{
-    hideAuxiliaryText ();
-}
-
-void
-BopomofoEngine::slotUpdateLookupTable (LookupTable & table, gboolean visible)
-{
-    updateLookupTable (table, visible);
-}
-
-void
-BopomofoEngine::slotUpdateLookupTableFast (LookupTable & table, gboolean visible)
-{
-    updateLookupTableFast (table, visible);
-}
-
-void
-BopomofoEngine::slotShowLookupTable (void)
-{
-    showLookupTable ();
-}
-
-void
-BopomofoEngine::slotHideLookupTable (void)
-{
-    hideLookupTable ();
-}
-
-void
-BopomofoEngine::slotUpdateProperty (Property & prop)
-{
-    updateProperty (prop);
-}
-
-void
 BopomofoEngine::connectEditorSignals (EditorPtr editor)
 {
     editor->signalCommitText ().connect (
-        bind (&BopomofoEngine::slotCommitText, this, _1));
+        bind (&BopomofoEngine::commitText, this, _1));
 
     editor->signalUpdatePreeditText ().connect (
-        bind (&BopomofoEngine::slotUpdatePreeditText, this, _1, _2, _3));
+        bind (&BopomofoEngine::updatePreeditText, this, _1, _2, _3));
     editor->signalShowPreeditText ().connect (
-        bind (&BopomofoEngine::slotShowPreeditText, this));
+        bind (&BopomofoEngine::showPreeditText, this));
     editor->signalHidePreeditText ().connect (
-        bind (&BopomofoEngine::slotHidePreeditText, this));
+        bind (&BopomofoEngine::hidePreeditText, this));
 
     editor->signalUpdateAuxiliaryText ().connect (
-        bind (&BopomofoEngine::slotUpdateAuxiliaryText, this, _1, _2));
+        bind (&BopomofoEngine::updateAuxiliaryText, this, _1, _2));
     editor->signalShowAuxiliaryText ().connect (
-        bind (&BopomofoEngine::slotShowAuxiliaryText, this));
+        bind (&BopomofoEngine::showAuxiliaryText, this));
     editor->signalHideAuxiliaryText ().connect (
-        bind (&BopomofoEngine::slotHideAuxiliaryText, this));
+        bind (&BopomofoEngine::hideAuxiliaryText, this));
 
     editor->signalUpdateLookupTable ().connect (
-        bind (&BopomofoEngine::slotUpdateLookupTable, this, _1, _2));
+        bind (&BopomofoEngine::updateLookupTable, this, _1, _2));
     editor->signalUpdateLookupTableFast ().connect (
-        bind (&BopomofoEngine::slotUpdateLookupTableFast, this, _1, _2));
+        bind (&BopomofoEngine::updateLookupTableFast, this, _1, _2));
     editor->signalShowLookupTable ().connect (
-        bind (&BopomofoEngine::slotShowLookupTable, this));
+        bind (&BopomofoEngine::showLookupTable, this));
     editor->signalHideLookupTable ().connect (
-        bind (&BopomofoEngine::slotHideLookupTable, this));
+        bind (&BopomofoEngine::hideLookupTable, this));
 }
 
 };
index fc15d17..bbd6bac 100644 (file)
@@ -46,18 +46,7 @@ private:
     void connectEditorSignals (EditorPtr editor);
 
 private:
-    void slotCommitText (Text & text);
-    void slotUpdatePreeditText (Text & text, guint cursor, gboolean visible);
-    void slotShowPreeditText (void);
-    void slotHidePreeditText (void);
-    void slotUpdateAuxiliaryText (Text & text, gboolean visible);
-    void slotShowAuxiliaryText (void);
-    void slotHideAuxiliaryText (void);
-    void slotUpdateLookupTable (LookupTable &table, gboolean visible);
-    void slotUpdateLookupTableFast (LookupTable &table, gboolean visible);
-    void slotShowLookupTable (void);
-    void slotHideLookupTable (void);
-    void slotUpdateProperty (Property & prop);
+    void commitText (Text & text);
 
 private:
     PinyinProperties m_props;
index b0a4131..84d7d5a 100644 (file)
@@ -37,7 +37,7 @@ PinyinEngine::PinyinEngine (IBusEngine *engine)
     m_editors[MODE_RAW].reset (new RawEditor (m_props));
     m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props));
 
-    m_props.signalUpdateProperty ().connect (bind (&PinyinEngine::slotUpdateProperty, this, _1));
+    m_props.signalUpdateProperty ().connect (bind (&PinyinEngine::updateProperty, this, _1));
 
     for (i = MODE_INIT; i < MODE_LAST; i++) {
         connectEditorSignals (m_editors[i]);
@@ -201,9 +201,9 @@ PinyinEngine::candidateClicked (guint index, guint button, guint state)
 }
 
 void
-PinyinEngine::slotCommitText (Text & text)
+PinyinEngine::commitText (Text & text)
 {
-    commitText (text);
+    Engine::commitText (text);
     if (m_input_mode != MODE_INIT)
         m_input_mode = MODE_INIT;
     if (text.text ())
@@ -213,99 +213,33 @@ PinyinEngine::slotCommitText (Text & text)
 }
 
 void
-PinyinEngine::slotUpdatePreeditText (Text & text, guint cursor, gboolean visible)
-{
-    updatePreeditText (text, cursor, visible);
-}
-
-void
-PinyinEngine::slotShowPreeditText (void)
-{
-    showPreeditText ();
-}
-
-void
-PinyinEngine::slotHidePreeditText (void)
-{
-    hidePreeditText ();
-}
-
-void
-PinyinEngine::slotUpdateAuxiliaryText (Text & text, gboolean visible)
-{
-    updateAuxiliaryText (text, visible);
-}
-
-void
-PinyinEngine::slotShowAuxiliaryText (void)
-{
-    showAuxiliaryText ();
-}
-
-void
-PinyinEngine::slotHideAuxiliaryText (void)
-{
-    hideAuxiliaryText ();
-}
-
-void
-PinyinEngine::slotUpdateLookupTable (LookupTable & table, gboolean visible)
-{
-    updateLookupTable (table, visible);
-}
-
-void
-PinyinEngine::slotUpdateLookupTableFast (LookupTable & table, gboolean visible)
-{
-    updateLookupTableFast (table, visible);
-}
-
-void
-PinyinEngine::slotShowLookupTable (void)
-{
-    showLookupTable ();
-}
-
-void
-PinyinEngine::slotHideLookupTable (void)
-{
-    hideLookupTable ();
-}
-
-void
-PinyinEngine::slotUpdateProperty (Property & prop)
-{
-    updateProperty (prop);
-}
-
-void
 PinyinEngine::connectEditorSignals (EditorPtr editor)
 {
     editor->signalCommitText ().connect (
-        bind (&PinyinEngine::slotCommitText, this, _1));
+        bind (&PinyinEngine::commitText, this, _1));
 
     editor->signalUpdatePreeditText ().connect (
-        bind (&PinyinEngine::slotUpdatePreeditText, this, _1, _2, _3));
+        bind (&PinyinEngine::updatePreeditText, this, _1, _2, _3));
     editor->signalShowPreeditText ().connect (
-        bind (&PinyinEngine::slotShowPreeditText, this));
+        bind (&PinyinEngine::showPreeditText, this));
     editor->signalHidePreeditText ().connect (
-        bind (&PinyinEngine::slotHidePreeditText, this));
+        bind (&PinyinEngine::hidePreeditText, this));
 
     editor->signalUpdateAuxiliaryText ().connect (
-        bind (&PinyinEngine::slotUpdateAuxiliaryText, this, _1, _2));
+        bind (&PinyinEngine::updateAuxiliaryText, this, _1, _2));
     editor->signalShowAuxiliaryText ().connect (
-        bind (&PinyinEngine::slotShowAuxiliaryText, this));
+        bind (&PinyinEngine::showAuxiliaryText, this));
     editor->signalHideAuxiliaryText ().connect (
-        bind (&PinyinEngine::slotHideAuxiliaryText, this));
+        bind (&PinyinEngine::hideAuxiliaryText, this));
 
     editor->signalUpdateLookupTable ().connect (
-        bind (&PinyinEngine::slotUpdateLookupTable, this, _1, _2));
+        bind (&PinyinEngine::updateLookupTable, this, _1, _2));
     editor->signalUpdateLookupTableFast ().connect (
-        bind (&PinyinEngine::slotUpdateLookupTableFast, this, _1, _2));
+        bind (&PinyinEngine::updateLookupTableFast, this, _1, _2));
     editor->signalShowLookupTable ().connect (
-        bind (&PinyinEngine::slotShowLookupTable, this));
+        bind (&PinyinEngine::showLookupTable, this));
     editor->signalHideLookupTable ().connect (
-        bind (&PinyinEngine::slotHideLookupTable, this));
+        bind (&PinyinEngine::hideLookupTable, this));
 }
 
 };
index e4f8cb8..377e85c 100644 (file)
@@ -46,18 +46,7 @@ private:
     void connectEditorSignals (EditorPtr editor);
 
 private:
-    void slotCommitText (Text & text);
-    void slotUpdatePreeditText (Text & text, guint cursor, gboolean visible);
-    void slotShowPreeditText (void);
-    void slotHidePreeditText (void);
-    void slotUpdateAuxiliaryText (Text & text, gboolean visible);
-    void slotShowAuxiliaryText (void);
-    void slotHideAuxiliaryText (void);
-    void slotUpdateLookupTable (LookupTable &table, gboolean visible);
-    void slotUpdateLookupTableFast (LookupTable &table, gboolean visible);
-    void slotShowLookupTable (void);
-    void slotHideLookupTable (void);
-    void slotUpdateProperty (Property & prop);
+    void commitText (Text & text);
 
 private:
     PinyinProperties m_props;