summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/PYLibPinyin.h5
-rw-r--r--src/PYPinyinBaseEditor.h11
2 files changed, 11 insertions, 5 deletions
diff --git a/src/PYLibPinyin.h b/src/PYLibPinyin.h
index cfd8566..d3bc90c 100644
--- a/src/PYLibPinyin.h
+++ b/src/PYLibPinyin.h
@@ -22,6 +22,8 @@
#ifndef __PY_LIB_PINYIN_H_
#define __PY_LIB_PINYIN_H_
+typedef struct _pinyin_context_t pinyin_context_t;
+
namespace PY {
class LibPinyinBackEnd{
public:
@@ -29,6 +31,9 @@ public:
static LibPinyinBackEnd & instance (void) { return *m_instance; }
private:
+ pinyin_context_t *m_pinyin_context; /* libpinyin context */
+
+private:
static std::unique_ptr<LibPinyinBackEnd> m_instance;
};
};
diff --git a/src/PYPinyinBaseEditor.h b/src/PYPinyinBaseEditor.h
index 0bed00a..ee200a1 100644
--- a/src/PYPinyinBaseEditor.h
+++ b/src/PYPinyinBaseEditor.h
@@ -18,8 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __PY_PINYIN_BASE_EDITOR_H_
-#define __PY_PINYIN_BASE_EDITOR_H_
+#ifndef __PY_LIB_PINYIN_BASE_EDITOR_H_
+#define __PY_LIB_PINYIN_BASE_EDITOR_H_
#include <libpinyin.h>
#include "PYLookupTable.h"
@@ -29,9 +29,9 @@
namespace PY {
-class PinyinBaseEditor : public Editor {
+class LibPinyinBaseEditor : public Editor {
public:
- PinyinBaseEditor (PinyinProperties & props, Config & config);
+ LibPinyinBaseEditor (PinyinProperties & props, Config & config);
public:
/* virtual functions */
@@ -81,7 +81,8 @@ protected:
PinyinArray m_pinyin;
guint m_pinyin_len;
LookupTable m_lookup_table;
- /* libpinyin singleton here. */
+
+ /* use LibPinyinBackEnd here. */
std::vector<std::string> m_special_phrases;
std::string m_selected_special_phrase;
};