summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/PYMain.cc2
-rw-r--r--src/PYPBopomofoEditor.cc4
-rw-r--r--src/PYPDoublePinyinEditor.cc8
-rw-r--r--src/PYPDoublePinyinEditor.h1
-rw-r--r--src/PYPFullPinyinEditor.cc4
-rw-r--r--src/PYPPinyinEditor.h2
6 files changed, 18 insertions, 3 deletions
diff --git a/src/PYMain.cc b/src/PYMain.cc
index d24cc3c..ae7c4cd 100644
--- a/src/PYMain.cc
+++ b/src/PYMain.cc
@@ -87,9 +87,9 @@ start_component (void)
}
Database::init ();
+ LibPinyinBackEnd::init ();
PinyinConfig::init (bus);
BopomofoConfig::init (bus);
- LibPinyinBackEnd::init ();
g_signal_connect ((IBusBus *)bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc
index 1945183..f13fcc9 100644
--- a/src/PYPBopomofoEditor.cc
+++ b/src/PYPBopomofoEditor.cc
@@ -20,6 +20,7 @@
*/
#include "PYPBopomofoEditor.h"
#include "PYConfig.h"
+#include "PYLibPinyin.h"
#include "PYPinyinProperties.h"
#include "PYSimpTradConverter.h"
#include "PYHalfFullConverter.h"
@@ -48,10 +49,13 @@ LibPinyinBopomofoEditor::LibPinyinBopomofoEditor
: LibPinyinPhoneticEditor (props, config),
m_select_mode (FALSE)
{
+ m_instance = LibPinyinBackEnd::instance ().allocChewingInstance ();
}
LibPinyinBopomofoEditor::~LibPinyinBopomofoEditor (void)
{
+ LibPinyinBackEnd::instance ().freeChewingInstance (m_instance);
+ m_instance = NULL;
}
void
diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc
index d37a480..8db80a4 100644
--- a/src/PYPDoublePinyinEditor.cc
+++ b/src/PYPDoublePinyinEditor.cc
@@ -21,6 +21,7 @@
#include "PYPDoublePinyinEditor.h"
#include "PYConfig.h"
+#include "PYLibPinyin.h"
#define DEFINE_DOUBLE_PINYIN_TABLES
#include "PYDoublePinyinTable.h"
@@ -48,6 +49,13 @@ LibPinyinDoublePinyinEditor::LibPinyinDoublePinyinEditor
( PinyinProperties & props, Config & config)
: LibPinyinPinyinEditor (props, config)
{
+ m_instance = LibPinyinBackEnd::instance ().allocPinyinInstance ();
+}
+
+LibPinyinDoublePinyinEditor::~LibPinyinDoublePinyinEditor (void)
+{
+ LibPinyinBackEnd::instance ().freePinyinInstance (m_instance);
+ m_instance = NULL;
}
gboolean
diff --git a/src/PYPDoublePinyinEditor.h b/src/PYPDoublePinyinEditor.h
index b06e144..0989a24 100644
--- a/src/PYPDoublePinyinEditor.h
+++ b/src/PYPDoublePinyinEditor.h
@@ -29,6 +29,7 @@ class LibPinyinDoublePinyinEditor : public LibPinyinPinyinEditor {
public:
LibPinyinDoublePinyinEditor (PinyinProperties & props, Config & config);
+ ~LibPinyinDoublePinyinEditor (void);
gboolean insert (gint ch);
diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc
index 064ae40..f07204b 100644
--- a/src/PYPFullPinyinEditor.cc
+++ b/src/PYPFullPinyinEditor.cc
@@ -21,6 +21,7 @@
#include "PYPFullPinyinEditor.h"
#include "PYConfig.h"
+#include "PYLibPinyin.h"
using namespace PY;
@@ -28,10 +29,13 @@ LibPinyinFullPinyinEditor::LibPinyinFullPinyinEditor
(PinyinProperties & props, Config & config)
: LibPinyinPinyinEditor (props, config)
{
+ m_instance = LibPinyinBackEnd::instance ().allocPinyinInstance ();
}
LibPinyinFullPinyinEditor::~LibPinyinFullPinyinEditor (void)
{
+ LibPinyinBackEnd::instance ().freePinyinInstance (m_instance);
+ m_instance = NULL;
}
void
diff --git a/src/PYPPinyinEditor.h b/src/PYPPinyinEditor.h
index 87fe210..3c61918 100644
--- a/src/PYPPinyinEditor.h
+++ b/src/PYPPinyinEditor.h
@@ -29,8 +29,6 @@ namespace PY {
class Config;
-class SpecialPhraseTable;
-
class LibPinyinPinyinEditor : public LibPinyinPhoneticEditor {
public:
LibPinyinPinyinEditor (PinyinProperties & props, Config & config);