summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-12-02 14:20:51 +0800
committerPeng Wu <alexepico@gmail.com>2014-12-02 14:20:51 +0800
commit5d445470457a3bbf3684ef782410ce9cafac57e3 (patch)
tree86018cc85aa5dc2657ca782bfdf5aaf1eaef7946
parent43beca819b9e4ab2f71b6cde4e085525df088719 (diff)
downloadibus-libpinyin-5d445470457a3bbf3684ef782410ce9cafac57e3.tar.gz
ibus-libpinyin-5d445470457a3bbf3684ef782410ce9cafac57e3.tar.xz
ibus-libpinyin-5d445470457a3bbf3684ef782410ce9cafac57e3.zip
add four new config keys
-rw-r--r--src/PYConfig.h10
-rw-r--r--src/PYPConfig.cc20
2 files changed, 27 insertions, 3 deletions
diff --git a/src/PYConfig.h b/src/PYConfig.h
index 263642a..9eec5a6 100644
--- a/src/PYConfig.h
+++ b/src/PYConfig.h
@@ -45,7 +45,11 @@ public:
pinyin_option_t option (void) const { return m_option & m_option_mask; }
guint orientation (void) const { return m_orientation; }
guint pageSize (void) const { return m_page_size; }
- gboolean ctrlSwitch(void) const { return m_ctrl_switch; }
+ G_DEPRECATED gboolean ctrlSwitch (void) const{ return m_ctrl_switch; }
+ std::string mainSwitch (void) const { return m_main_switch; }
+ std::string letterSwitch (void) const { return m_letter_switch; }
+ std::string punctSwitch (void) const { return m_punct_switch; }
+ std::string tradSwitch (void) const { return m_trad_switch; }
gboolean shiftSelectCandidate (void) const { return m_shift_select_candidate; }
gboolean minusEqualPage (void) const { return m_minus_equal_page; }
gboolean commaPeriodPage (void) const { return m_comma_period_page; }
@@ -91,6 +95,10 @@ protected:
gint m_orientation;
guint m_page_size;
gboolean m_ctrl_switch;
+ std::string m_main_switch;
+ std::string m_letter_switch;
+ std::string m_punct_switch;
+ std::string m_trad_switch;
gboolean m_shift_select_candidate;
gboolean m_minus_equal_page;
gboolean m_comma_period_page;
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index a6b8902..6aaa116 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -33,6 +33,10 @@ const gchar * const CONFIG_FUZZY_PINYIN = "FuzzyPinyin";
const gchar * const CONFIG_ORIENTATION = "LookupTableOrientation";
const gchar * const CONFIG_PAGE_SIZE = "LookupTablePageSize";
const gchar * const CONFIG_CTRL_SWITCH = "CtrlSwitch";
+const gchar * const CONFIG_MAIN_SWITCH = "MainSwitch";
+const gchar * const CONFIG_LETTER_SWITCH = "LetterSwitch";
+const gchar * const CONFIG_PUNCT_SWITCH = "PunctSwitch";
+const gchar * const CONFIG_TRAD_SWITCH = "TradSwitch";
const gchar * const CONFIG_SHIFT_SELECT_CANDIDATE = "ShiftSelectCandidate";
const gchar * const CONFIG_MINUS_EQUAL_PAGE = "MinusEqualPage";
const gchar * const CONFIG_COMMA_PERIOD_PAGE = "CommaPeriodPage";
@@ -166,7 +170,11 @@ LibPinyinConfig::readDefaultValues (void)
g_warn_if_reached ();
}
m_ctrl_switch = read(CONFIG_CTRL_SWITCH, false);
- m_dictionaries = read (CONFIG_DICTIONARIES, std::string("2"));
+ m_main_switch = read(CONFIG_MAIN_SWITCH, std::string ("<Shift>"));
+ m_letter_switch = read(CONFIG_LETTER_SWITCH, std::string (""));
+ m_punct_switch = read(CONFIG_PUNCT_SWITCH, std::string ("<Control>period"));
+ m_trad_switch = read(CONFIG_TRAD_SWITCH, std::string ("<Control><Shift>f"));
+ m_dictionaries = read (CONFIG_DICTIONARIES, std::string ("2"));
/* fuzzy pinyin */
if (read (CONFIG_FUZZY_PINYIN, false))
@@ -212,8 +220,16 @@ LibPinyinConfig::valueChanged (const std::string &section,
}
} else if (CONFIG_CTRL_SWITCH == name) {
m_ctrl_switch = normalizeGVariant (value, false);
+ } else if (CONFIG_MAIN_SWITCH == name) {
+ m_main_switch = normalizeGVariant (value, std::string ("<Shift>"));
+ } else if (CONFIG_LETTER_SWITCH == name) {
+ m_letter_switch = normalizeGVariant (value, std::string (""));
+ } else if (CONFIG_PUNCT_SWITCH == name) {
+ m_punct_switch = normalizeGVariant (value, std::string ("<Control>period"));
+ } else if (CONFIG_TRAD_SWITCH == name) {
+ m_trad_switch = normalizeGVariant (value, std::string ("<Control><Shift>f"));
} else if (CONFIG_DICTIONARIES == name) {
- m_dictionaries = normalizeGVariant (value, std::string("2"));
+ m_dictionaries = normalizeGVariant (value, std::string ("2"));
}
/* fuzzy pinyin */
else if (CONFIG_FUZZY_PINYIN == name) {