diff options
author | Hiroshi Sumita <hsumita@chromium.org> | 2011-10-24 16:03:08 +0900 |
---|---|---|
committer | Hiroshi Sumita <hsumita@chromium.org> | 2011-10-24 16:03:08 +0900 |
commit | 838c43138aa564c38d6dfb9602fccfdbf379e4ef (patch) | |
tree | 47d4f6127ac721bbb9604504136f9f0a41167d74 | |
parent | e7e318308e5d830a9d32796addeefebd1af263c5 (diff) | |
download | pyzy-838c43138aa564c38d6dfb9602fccfdbf379e4ef.tar.gz |
fix variable types and code style.
BUG=None
TEST=Manual
Review URL: http://codereview.appspot.com/5299042
-rw-r--r-- | src/PyZyConfig.cc | 87 | ||||
-rw-r--r-- | src/PyZyInputContext.h | 4 |
2 files changed, 74 insertions, 17 deletions
diff --git a/src/PyZyConfig.cc b/src/PyZyConfig.cc index ffd16d9..344c72a 100644 --- a/src/PyZyConfig.cc +++ b/src/PyZyConfig.cc @@ -27,7 +27,7 @@ namespace PyZy { -const guint PINYIN_DEFAULT_OPTION = +const unsigned int PINYIN_DEFAULT_OPTION = PINYIN_INCOMPLETE_PINYIN | PINYIN_CORRECT_ALL | PINYIN_FUZZY_C_CH | @@ -78,19 +78,77 @@ Config::~Config () } /* Accessors */ -unsigned int Config::option (void) const { return m_impl->m_option; } -unsigned int Config::doublePinyinSchema (void) const { return m_impl->m_double_pinyin_schema; } -bool Config::specialPhrases (void) const { return m_impl->m_special_phrases; } -bool Config::modeSimp (void) const { return m_impl->m_mode_simp; } -unsigned int Config::bopomofoKeyboardMapping (void) const { return m_impl->m_bopomofo_keyboard_mapping; } -unsigned int Config::pageSize (void) const { return m_impl->m_page_size; } - -void Config::setOption (unsigned int value) { m_impl->m_option = value; } -void Config::setDoublePinyinSchema (unsigned int value) { m_impl->m_double_pinyin_schema = value; } -void Config::setSpecialPhrases (bool value) { m_impl->m_special_phrases = value; } -void Config::setModeSimp (bool value) { m_impl->m_mode_simp = value; } -void Config::setBopomofoKeyboardMapping (unsigned int value) { m_impl->m_bopomofo_keyboard_mapping = value; } -void Config::setPageSize (unsigned int value) { m_impl->m_page_size = value; } +unsigned int +Config::option (void) const +{ + return m_impl->m_option; +} + +unsigned int +Config::doublePinyinSchema (void) const +{ + return m_impl->m_double_pinyin_schema; +} + +bool +Config::specialPhrases (void) const +{ + return m_impl->m_special_phrases; +} + +bool +Config::modeSimp (void) const +{ + return m_impl->m_mode_simp; +} + +unsigned int +Config::bopomofoKeyboardMapping (void) const +{ + return m_impl->m_bopomofo_keyboard_mapping; +} + +unsigned int +Config::pageSize (void) const +{ + return m_impl->m_page_size; +} + +void +Config::setOption (unsigned int value) +{ + m_impl->m_option = value; +} + +void +Config::setDoublePinyinSchema (unsigned int value) +{ + m_impl->m_double_pinyin_schema = value; +} + +void +Config::setSpecialPhrases (bool value) +{ + m_impl->m_special_phrases = value; +} + +void +Config::setModeSimp (bool value) +{ + m_impl->m_mode_simp = value; +} + +void +Config::setBopomofoKeyboardMapping (unsigned int value) +{ + m_impl->m_bopomofo_keyboard_mapping = value; +} + +void +Config::setPageSize (unsigned int value) +{ + m_impl->m_page_size = value; +} void Config::readDefaultValues () @@ -104,7 +162,6 @@ Config::readDefaultValues () m_impl->m_bopomofo_keyboard_mapping = 0; } - /* Pinyin Config */ struct PinyinConfig::PinyinConfigImpl { static std::unique_ptr <PinyinConfig> m_instance; diff --git a/src/PyZyInputContext.h b/src/PyZyInputContext.h index 3806bd3..6950f05 100644 --- a/src/PyZyInputContext.h +++ b/src/PyZyInputContext.h @@ -40,8 +40,8 @@ struct Candidate { CandidateType type; }; -// lower 8bits of vkey_code should be zero. -enum vkey_code { +// lower 8bits of VKeyCode should be zero. +enum VKeyCode { VKEY_FIRST = 1 << 8, VKEY_COMMIT = (10 << 8), |