diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-20 11:02:17 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-20 11:02:17 +0800 |
| commit | 54c52e2f73805029cecf34c5af5e577ba5845ab8 (patch) | |
| tree | 2f5123b5d3495a1ee30f25334ecc2104a1dad756 /daemon | |
| parent | bac2b876fe4d18448b0491babb0d5ed3bdf56102 (diff) | |
| download | ibus-54c52e2f73805029cecf34c5af5e577ba5845ab8.tar.gz ibus-54c52e2f73805029cecf34c5af5e577ba5845ab8.tar.xz ibus-54c52e2f73805029cecf34c5af5e577ba5845ab8.zip | |
Define CAPS.
Diffstat (limited to 'daemon')
| -rw-r--r-- | daemon/inputcontext.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/daemon/inputcontext.py b/daemon/inputcontext.py index 26c8f8a..8e433a2 100644 --- a/daemon/inputcontext.py +++ b/daemon/inputcontext.py @@ -22,6 +22,11 @@ import gobject import ibus +IBUS_CAP_PREEDIT = 1 +IBUS_CAP_AUX_STRING = 1 << 1 +IBUS_CAP_LOOKUP_TABLE = 1 << 2 +IBUS_CAP_FOCUS = 1 << 3 + class InputContext(ibus.Object): id = 1 __gsignals__ = { @@ -187,10 +192,10 @@ class InputContext(ibus.Object): return self.__enable def set_capabilities(self, caps): - self.__support_preedit = (caps & (1 << 0)) != 0 - self.__support_aux_string = (caps & (1 << 1)) != 0 - self.__support_lookup_table = (caps & (1 << 2)) != 0 - self.__support_focus = (caps & (1 << 3)) != 0 + self.__support_preedit = bool(caps & IBUS_CAP_PREEDIT) + self.__support_aux_string = bool(caps & IBUS_CAP_AUX_STRING) + self.__support_lookup_table = bool(caps & IBUS_CAP_LOOKUP_TABLE) + self.__support_focus = bool(caps & IBUS_CAP_FOCUS) def get_support_focus(self): return self.__support_focus |
