From 42fdd95eeea6e72f65fe74e356b6ab96bc95666c Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 8 Feb 2013 10:29:05 +0800 Subject: write clearPinyinUserData --- src/PYLibPinyin.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/PYLibPinyin.cc') diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc index 3187706..811400c 100644 --- a/src/PYLibPinyin.cc +++ b/src/PYLibPinyin.cc @@ -20,6 +20,8 @@ */ #include "PYLibPinyin.h" + +#include #include #include "PYPConfig.h" @@ -237,6 +239,18 @@ LibPinyinBackEnd::modified (void) static_cast (this)); } +bool +LibPinyinBackEnd::clearPinyinUserData (const char * target) +{ + if (0 == strcmp("all", target)) + pinyin_mask_out(m_pinyin_context, 0x0, 0x0); + else if (0 == strcmp("user", target)) + pinyin_mask_out(m_pinyin_context, PHRASE_INDEX_LIBRARY_MASK, + PHRASE_INDEX_MAKE_TOKEN(15, null_token)); + else + g_warning("unknown clear target: %s.\n", target); +} + gboolean LibPinyinBackEnd::timeoutCallback (gpointer data) { -- cgit