summaryrefslogtreecommitdiff
path: root/ibus
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2012-10-16 10:28:26 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2012-10-16 10:28:26 +0900
commitafdb7f6c33fda44c2ad4054b7c23523d59218f47 (patch)
tree824bea2460d0756738cba7744980338c5a01f838 /ibus
parentf9059d696390c01564a196dd4a5b2cd39ef6d7ac (diff)
downloadibus-afdb7f6c33fda44c2ad4054b7c23523d59218f47.tar.gz
Add layout_variant and layout_option in IBusEngineDesc for XKB.
TEST=Manually Review URL: https://codereview.appspot.com/6586075
Diffstat (limited to 'ibus')
-rw-r--r--ibus/enginedesc.py71
1 files changed, 46 insertions, 25 deletions
diff --git a/ibus/enginedesc.py b/ibus/enginedesc.py
index 055a3a0d..00fbade2 100644
--- a/ibus/enginedesc.py
+++ b/ibus/enginedesc.py
@@ -31,7 +31,10 @@ from serializable import *
class EngineDesc(Serializable):
__gtype_name__ = "PYIBusEngineDesc"
__NAME__ = "IBusEngineDesc"
- def __init__(self, name="", longname="", description="", language="", license="", author="", icon="", layout="", hotkeys="", rank=0, symbol="", setup=""):
+ def __init__(self, name="", longname="", description="", language="",
+ license="", author="", icon="", layout="us", hotkeys="",
+ rank=0, symbol="", setup="",
+ layout_variant="", layout_option=""):
super(EngineDesc, self).__init__()
self.__name = name
self.__longname = longname
@@ -41,6 +44,8 @@ class EngineDesc(Serializable):
self.__author = author
self.__icon = icon
self.__layout = layout
+ self.__layout_variant = layout_variant
+ self.__layout_option = layout_option
self.__rank = rank
self.__hotkeys = hotkeys
self.__symbol = symbol
@@ -70,6 +75,12 @@ class EngineDesc(Serializable):
def get_layout(self):
return self.__layout
+ def get_layout_variant(self):
+ return self.__layout_variant
+
+ def get_layout_option(self):
+ return self.__layout_option
+
def get_rank(self):
return self.__rank
@@ -82,18 +93,20 @@ class EngineDesc(Serializable):
def get_setup(self):
return self.__setup
- name = property(get_name)
- longname = property(get_longname)
- description = property(get_description)
- language = property(get_language)
- license = property(get_license)
- author = property(get_author)
- icon = property(get_icon)
- layout = property(get_layout)
- rank = property(get_rank)
- hotkeys = property(get_hotkeys)
- symbol = property(get_symbol)
- setup = property(get_setup)
+ name = property(get_name)
+ longname = property(get_longname)
+ description = property(get_description)
+ language = property(get_language)
+ license = property(get_license)
+ author = property(get_author)
+ icon = property(get_icon)
+ layout = property(get_layout)
+ layout_variant = property(get_layout_variant)
+ layout_option = property(get_layout_option)
+ rank = property(get_rank)
+ hotkeys = property(get_hotkeys)
+ symbol = property(get_symbol)
+ setup = property(get_setup)
def serialize(self, struct):
super(EngineDesc, self).serialize(struct)
@@ -106,24 +119,32 @@ class EngineDesc(Serializable):
struct.append(dbus.String(self.__icon))
struct.append(dbus.String(self.__layout))
struct.append(dbus.UInt32(self.__rank))
+ # Keep the serialize order.
struct.append(dbus.String(self.__hotkeys))
struct.append(dbus.String(self.__symbol))
struct.append(dbus.String(self.__setup))
+ struct.append(dbus.String(self.__layout_variant))
+ struct.append(dbus.String(self.__layout_option))
def deserialize(self, struct):
super(EngineDesc, self).deserialize(struct)
- self.__name = struct.pop(0)
- self.__longname = struct.pop(0)
- self.__description = struct.pop(0)
- self.__language = struct.pop(0)
- self.__license = struct.pop(0)
- self.__author = struct.pop(0)
- self.__icon = struct.pop(0)
- self.__layout = struct.pop(0)
- self.__rank = struct.pop(0)
- self.__hotkeys = struct.pop(0)
- self.__symbol = struct.pop(0)
- self.__setup = struct.pop(0)
+ self.__name = struct.pop(0)
+ self.__longname = struct.pop(0)
+ self.__description = struct.pop(0)
+ self.__language = struct.pop(0)
+ self.__license = struct.pop(0)
+ self.__author = struct.pop(0)
+ self.__icon = struct.pop(0)
+ self.__layout = struct.pop(0)
+ self.__rank = struct.pop(0)
+ # Keep the serialize order.
+ self.__hotkeys = struct.pop(0)
+ self.__symbol = struct.pop(0)
+ self.__setup = struct.pop(0)
+ if len(struct) < 2:
+ return
+ self.__layout_variant = struct.pop(0)
+ self.__layout_option = struct.pop(0)
def test():
engine = EngineDesc("Hello", "", "", "", "", "", "", "", "", 0, "", "")