summaryrefslogtreecommitdiffstats
path: root/src/PYPPinyinEngine.cc
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-10-10 15:48:29 +0800
committerPeng Wu <alexepico@gmail.com>2013-10-10 15:48:33 +0800
commit69f50424ba5be49c4b31543df7bd7970361d4753 (patch)
tree2e525ed4aca9a882b3039b4d343438bb073a9b5f /src/PYPPinyinEngine.cc
parentcf8ab7d8e76ed70c182c7588cfe1ebbce8e5174b (diff)
downloadibus-libpinyin-69f50424ba5be49c4b31543df7bd7970361d4753.tar.gz
ibus-libpinyin-69f50424ba5be49c4b31543df7bd7970361d4753.tar.xz
ibus-libpinyin-69f50424ba5be49c4b31543df7bd7970361d4753.zip
support setContentType method
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r--src/PYPPinyinEngine.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index ce74be1..d28dc6f 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -50,6 +50,10 @@ LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine)
{
gint i;
+#if IBUS_CHECK_VERSION (1, 5, 4)
+ m_input_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
+#endif
+
m_double_pinyin = LibPinyinPinyinConfig::instance ().doublePinyin ();
if (m_double_pinyin)
@@ -100,6 +104,11 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
{
gboolean retval = FALSE;
+#if IBUS_CHECK_VERSION (1, 5, 4)
+ if (IBUS_INPUT_PURPOSE_PASSWORD == m_input_purpose)
+ return retval;
+#endif
+
/* check Shift or Ctrl + Release hotkey,
* and then ignore other Release key event */
if (modifiers & IBUS_RELEASE_MASK) {
@@ -222,9 +231,22 @@ LibPinyinPinyinEngine::focusIn (void)
void
LibPinyinPinyinEngine::focusOut (void)
{
+
+#if IBUS_CHECK_VERSION (1, 5, 4)
+ m_input_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
+#endif
+
reset ();
}
+#if IBUS_CHECK_VERSION(1, 5, 4)
+void
+LibPinyinPinyinEngine::setContentType (guint purpose, guint hints)
+{
+ m_input_purpose = (IBusInputPurpose) purpose;
+}
+#endif
+
void
LibPinyinPinyinEngine::reset (void)
{