/* Here are the fuzzy pinyin options conversion table. */
static const struct {
guint ibus_pinyin_option;
- PinyinAmbiguity libpinyin_option;
+ PinyinAmbiguity libpinyin_option;
} fuzzy_options [] = {
/* fuzzy pinyin */
{ PINYIN_FUZZY_C_CH, PINYIN_AmbCiChi },
{ PINYIN_FUZZY_ING_IN, PINYIN_AmbIngIn }
};
+
gboolean
LibPinyinBackEnd::setPinyinOptions (Config * config)
{
return TRUE;
}
+
+/* Here are the chewing keyboard scheme mapping table. */
+static const struct {
+ guint bopomofo_keyboard;
+ PinyinZhuYinScheme chewing_keyboard;
+} chewing_options [] = {
+ {0, ZHUYIN_STANDARD},
+ {1, ZHUYIN_GIN_YIEH},
+ {2, ZHUYIN_ET26},
+ {3, ZHUYIN_IBM}
+};
+
+
+gboolean
+LibPinyinBackEnd::setChewingOptions (Config *config)
+{
+ const guint map = config->bopomofoKeyboardMapping ();
+ for (guint i = 0; i < G_N_ELEMENTS (chewing_options); i++) {
+ if (map == chewing_options[i].bopomofo_keyboard){
+ /* TODO: set chewing scheme. */
+ PinyinZhuYinScheme scheme = chewing_options[i].chewing_keyboard;
+ g_assert (FALSE);
+ }
+ }
+ return TRUE;
+}
LibPinyinBackEnd();
~LibPinyinBackEnd();
- gboolean setPinyinOptions(Config *config);
+ gboolean setPinyinOptions (Config *config);
+ gboolean setChewingOptions (Config *config);
/* use static initializer in C++. */
static LibPinyinBackEnd & instance (void) { return *m_instance; }