public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Updated ibus-xx-bridge-hotkey.patch
@ 2026-05-31 2:05 Takao Fujiwara
0 siblings, 0 replies; 3+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 095f9c1f6a7f351122b2dff35cfaccdc340f80a9
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2011-08-07T00:54:54+09:00
Stats : +1629/-497 in 8 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/095f9c1f6a7f351122b2dff35cfaccdc340f80a9?branch=autotool
Log:
Updated ibus-xx-bridge-hotkey.patch
Updated transitional ibus-gnome3 package.
- Identified XKB keymaps by engines.
- Fixed Bug 726289 - no candidates with ibus-mozc.
- Triaged Bug 707370 SetEngine timeout
---
diff --git a/.gitignore b/.gitignore
index b2dfc17..d735925 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ ibus-1.3.6.tar.gz
/ibus-1.3.99.20110419.tar.gz
/ibus_master_da.po
/ibus-gjs-1.3.99.20110720.tar.gz
+/ibus-gjs-1.3.99.20110806.tar.gz
diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch
index 3fc48a6..6a64b82 100644
--- a/ibus-541492-xkb.patch
+++ b/ibus-541492-xkb.patch
@@ -1,6 +1,6 @@
-From 14986cb38f431d132332b2e8f9da1ca2b8a5d10e Mon Sep 17 00:00:00 2001
+From a253acde0935efae4bbc8aa59ca47ab273b9907b Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 29 Jun 2011 16:52:08 +0900
+Date: Fri, 5 Aug 2011 20:22:42 +0900
Subject: [PATCH] Add XKB layouts
---
@@ -12,8 +12,8 @@ Subject: [PATCH] Add XKB layouts
ibus/__init__.py | 2 +
ibus/bus.py | 3 +
ibus/interface/iibus.py | 3 +
- ibus/xkblayout.py.in | 215 ++++++++++++++++
- ibus/xkbxml.py.in | 413 ++++++++++++++++++++++++++++++
+ ibus/xkblayout.py.in | 230 +++++++++++++++++
+ ibus/xkbxml.py.in | 416 ++++++++++++++++++++++++++++++
setup/Makefile.am | 1 +
setup/enginecombobox.py | 7 +-
setup/main.py | 3 +
@@ -21,22 +21,20 @@ Subject: [PATCH] Add XKB layouts
setup/xkbsetup.py | 454 +++++++++++++++++++++++++++++++++
src/Makefile.am | 5 +
src/ibus.h | 1 +
- src/ibusfactory.c | 21 ++-
- src/ibusfactory.h | 5 +-
src/ibusxkbxml.c | 440 ++++++++++++++++++++++++++++++++
src/ibusxkbxml.h | 172 +++++++++++++
- ui/gtk/panel.py | 39 +++
+ ui/gtk/panel.py | 41 +++
xkb/Makefile.am | 104 ++++++++
- xkb/ibus-engine-xkb-main.c | 397 +++++++++++++++++++++++++++++
+ xkb/ibus-engine-xkb-main.c | 413 ++++++++++++++++++++++++++++++
xkb/ibus-engine-xkb-main.h | 46 ++++
xkb/ibus-xkb-main.c | 112 ++++++++
xkb/xkblayout.xml.in | 16 ++
xkb/xkblayoutconfig.xml.in | 6 +
xkb/xkblib.c | 327 ++++++++++++++++++++++++
xkb/xkblib.h | 41 +++
- xkb/xkbxml.c | 335 ++++++++++++++++++++++++
- xkb/xkbxml.h | 110 ++++++++
- 32 files changed, 4008 insertions(+), 6 deletions(-)
+ xkb/xkbxml.c | 339 ++++++++++++++++++++++++
+ xkb/xkbxml.h | 113 ++++++++
+ 30 files changed, 4027 insertions(+), 4 deletions(-)
create mode 100644 ibus/xkblayout.py.in
create mode 100644 ibus/xkbxml.py.in
create mode 100644 setup/xkbsetup.py
@@ -54,7 +52,7 @@ Subject: [PATCH] Add XKB layouts
create mode 100644 xkb/xkbxml.h
diff --git a/Makefile.am b/Makefile.am
-index 7be558b..59fbabb 100644
+index ff0fabc..056ddfc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,12 @@ DAEMON_DIRS = \
@@ -79,7 +77,7 @@ index 7be558b..59fbabb 100644
$(NULL)
diff --git a/configure.ac b/configure.ac
-index 5544dfa..85e5e30 100644
+index c3bd423..4c20ae7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,60 @@ else
@@ -143,7 +141,7 @@ index 5544dfa..85e5e30 100644
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([0.6.8])
-@@ -430,6 +484,7 @@ gconf/Makefile
+@@ -451,6 +505,7 @@ bindings/Makefile
gconf/gconf.xml.in
bindings/Makefile
bindings/vala/Makefile
@@ -151,7 +149,7 @@ index 5544dfa..85e5e30 100644
])
AC_OUTPUT
-@@ -445,6 +500,7 @@ Build options:
+@@ -466,6 +521,7 @@ Build options:
Build gtk2 immodule $enable_gtk2
Build gtk3 immodule $enable_gtk3
Build XIM agent server $enable_xim
@@ -160,10 +158,10 @@ index 5544dfa..85e5e30 100644
Build gconf modules $enable_gconf
Build memconf modules $enable_memconf
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index b75295e..7ca4899 100644
+index 663358c..8979515 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
-@@ -190,6 +190,42 @@
+@@ -191,6 +191,42 @@
</locale>
</schema>
<schema>
@@ -303,10 +301,10 @@ index 678d517..7de56fc 100644
diff --git a/ibus/xkblayout.py.in b/ibus/xkblayout.py.in
new file mode 100644
-index 0000000..4cb3ffd
+index 0000000..11fce12
--- /dev/null
+++ b/ibus/xkblayout.py.in
-@@ -0,0 +1,215 @@
+@@ -0,0 +1,230 @@
+# vim:set et sts=4 sw=4:
+#
+# ibus - The Input Bus
@@ -331,7 +329,7 @@ index 0000000..4cb3ffd
+# Boston, MA 02111-1307 USA
+
+__all__ = (
-+ "XKBLayout",
++ 'XKBLayout',
+ )
+
+import os, sys, time
@@ -354,8 +352,8 @@ index 0000000..4cb3ffd
+ self.__time_lag_session_xkb_timer = time.time()
+ self.__xkb_latin_layouts = []
+ if config != None:
-+ self.__xkb_latin_layouts = list(self.__config.get_value("general",
-+ "xkb_latin_layouts",
++ self.__xkb_latin_layouts = list(self.__config.get_value('general',
++ 'xkb_latin_layouts',
+ []))
+
+
@@ -363,12 +361,20 @@ index 0000000..4cb3ffd
+ left_bracket = layout.find('(')
+ right_bracket = layout.find(')')
+ if left_bracket >= 0 and right_bracket > left_bracket:
-+ return (layout[:left_bracket], \
++ return (layout[:left_bracket] + layout[right_bracket + 1:], \
+ layout[left_bracket + 1:right_bracket])
-+ return (layout, "default")
++ return (layout, 'default')
++
++ def __get_option_from_layout(self, layout):
++ left_bracket = layout.find('[')
++ right_bracket = layout.find(']')
++ if left_bracket >= 0 and right_bracket > left_bracket:
++ return (layout[:left_bracket] + layout[right_bracket + 1:], \
++ layout[left_bracket + 1:right_bracket])
++ return (layout, 'default')
+
+ def __get_output_from_cmdline(self, arg, string):
-+ exec_command = "%s %s" % (self.__command, arg)
++ exec_command = '%s %s' % (self.__command, arg)
+ retval = None
+ for line in os.popen(exec_command).readlines():
+ line = line.strip()
@@ -385,24 +391,24 @@ index 0000000..4cb3ffd
+ def get_layout(self):
+ if not self.__use_xkb:
+ return None
-+ return self.__get_output_from_cmdline("--get", "layout: ")
++ return self.__get_output_from_cmdline('--get', 'layout: ')
+
+ def get_model(self):
+ if not self.__use_xkb:
+ return None
-+ return self.__get_output_from_cmdline("--get", "model: ")
++ return self.__get_output_from_cmdline('--get', 'model: ')
+
+ def get_option(self):
+ if not self.__use_xkb:
+ return None
-+ return self.__get_output_from_cmdline("--get", "option: ")
++ return self.__get_output_from_cmdline('--get', 'option: ')
+
+ def get_group(self):
+ if not self.__use_xkb:
+ return 0
-+ return int(self.__get_output_from_cmdline("--get-group", "group: "))
++ return int(self.__get_output_from_cmdline('--get-group', 'group: '))
+
-+ def set_layout(self, layout="default", model="default", option="default"):
++ def set_layout(self, layout='default', model='default', option='default'):
+ if not self.__use_xkb:
+ return
+ if layout == None:
@@ -427,24 +433,31 @@ index 0000000..4cb3ffd
+ > XKB_SESSION_TIME_OUT):
+ self.__time_lag_session_xkb_layout = False
+ self.__time_lag_session_xkb_option = False
-+ if layout == "default":
++ if layout == 'default':
+ layout = self.__default_layout
+ else:
+ self.__time_lag_session_xkb_layout = False
+ if model != None:
+ model = str(model)
-+ if model == "default":
++ if model == 'default':
+ (layout, model) = self.__get_model_from_layout(layout)
-+ if model == "default":
++ if model == 'default':
+ model = self.__default_model
+ else:
+ self.__time_lag_session_xkb_layout = False
+ if option != None:
+ option = str(option)
-+ if option == "default":
++ if option == 'default':
++ (layout, engine_option) = self.__get_option_from_layout(layout)
++ if engine_option != None and engine_option != 'default':
++ option = self.__default_option
++ if option == None:
++ option = engine_option
++ else:
++ option = '%s,%s' % (option, engine_option)
++ self.__time_lag_session_xkb_option = False
++ if option == 'default':
+ option = self.__default_option
-+ else:
-+ self.__time_lag_session_xkb_option = False
+ need_us_layout = False
+ for latin_layout in self.__xkb_latin_layouts:
+ latin_layout = str(latin_layout)
@@ -455,9 +468,9 @@ index 0000000..4cb3ffd
+ need_us_layout = True
+ break
+ if need_us_layout:
-+ layout = layout + ",us"
++ layout = layout + ',us'
+ if model != None:
-+ model = model + ","
++ model = model + ','
+ if layout == self.get_layout() and \
+ model == self.get_model() and \
+ option == self.get_option():
@@ -465,25 +478,25 @@ index 0000000..4cb3ffd
+ args = []
+ args.append(self.__command)
+ args.append(os.path.basename(self.__command))
-+ args.append("--layout")
++ args.append('--layout')
+ args.append(layout)
+ if model != None:
-+ args.append("--model")
++ args.append('--model')
+ args.append(model)
+ if option != None:
-+ args.append("--option")
++ args.append('--option')
+ args.append(option)
+ pid = os.spawnl(os.P_NOWAIT, *args)
+ os.waitpid(pid, 0)
+
-+ def set_default_layout(self, layout="default", model="default"):
++ def set_default_layout(self, layout='default', model='default'):
+ if not self.__use_xkb:
+ return
+ if layout == None:
-+ print >> sys.stderr, "ibus.xkblayout: None layout"
++ print >> sys.stderr, 'ibus.xkblayout: None layout'
+ return
+ if model == None:
-+ print >> sys.stderr, "ibus.xkblayout: None model"
++ print >> sys.stderr, 'ibus.xkblayout: None model'
+ return
+ if layout == 'default':
+ self.__default_layout = self.get_layout()
@@ -498,11 +511,11 @@ index 0000000..4cb3ffd
+ else:
+ self.__default_model = model
+
-+ def set_default_option(self, option="default"):
++ def set_default_option(self, option='default'):
+ if not self.__use_xkb:
+ return
+ if option == None:
-+ print >> sys.stderr, "ibus.xkblayout: None option"
++ print >> sys.stderr, 'ibus.xkblayout: None option'
+ return
+ if option == 'default':
+ self.__default_option = self.get_option()
@@ -524,10 +537,10 @@ index 0000000..4cb3ffd
+ self.__default_option = self.get_option()
diff --git a/ibus/xkbxml.py.in b/ibus/xkbxml.py.in
new file mode 100644
-index 0000000..7e5a44e
+index 0000000..16f47df
--- /dev/null
+++ b/ibus/xkbxml.py.in
-@@ -0,0 +1,413 @@
+@@ -0,0 +1,416 @@
+# vim:set et sts=4 sw=4:
+#
+# ibus - The Input Bus
@@ -552,8 +565,8 @@ index 0000000..7e5a44e
+# Boston, MA 02111-1307 USA
+
+__all__ = (
-+ "XKBConfigRegistry",
-+ "XKBLayoutConfig",
++ 'XKBConfigRegistry',
++ 'XKBLayoutConfig',
+ )
+
+import os
@@ -569,7 +582,7 @@ index 0000000..7e5a44e
+except ImportError:
+ get_user_config_dir = lambda : None
+
-+XKB_RULES_XML_FILE = "@XKB_RULES_XML_FILE@"
++XKB_RULES_XML_FILE = '@XKB_RULES_XML_FILE@'
+
+class XKBConfigRegistryHandler(XMLFilterBase):
+ def __init__(self, parser=None, root='root'):
@@ -599,18 +612,18 @@ index 0000000..7e5a44e
+ if not self.__layout:
+ return
+ if self.__variant:
-+ if self.__current_node == "name":
++ if self.__current_node == 'name':
+ self.__variant_label = text
+ if self.__layout_label != None and \
+ self.__layout_label in self.__layoutlist_array:
+ self.__layoutlist_array[self.__layout_label].append(text)
-+ elif self.__current_node == "description":
-+ label = "%s(%s)" % (self.__layout_label, self.__variant_label)
++ elif self.__current_node == 'description':
++ label = '%s(%s)' % (self.__layout_label, self.__variant_label)
+ self.__variant_desc[label] = text
-+ elif self.__current_node == "iso639Id":
++ elif self.__current_node == 'iso639Id':
+ label = self.__layout_label
+ if label != None:
-+ label = "%s(%s)" % (label, self.__variant_label)
++ label = '%s(%s)' % (label, self.__variant_label)
+ else:
+ label = self.__variant_label
+ if label not in self.__layout_lang:
@@ -619,12 +632,12 @@ index 0000000..7e5a44e
+ else:
+ pass
+ else:
-+ if self.__current_node == "name":
++ if self.__current_node == 'name':
+ self.__layout_label = text
+ self.__layoutlist_array[self.__layout_label] = []
-+ elif self.__current_node == "description":
++ elif self.__current_node == 'description':
+ self.__layout_desc[self.__layout_label] = text
-+ elif self.__current_node == "iso639Id":
++ elif self.__current_node == 'iso639Id':
+ if self.__layout_label not in self.__layout_lang:
+ self.__layout_lang[self.__layout_label] = []
+ self.__layout_lang[self.__layout_label].append(text)
@@ -635,60 +648,60 @@ index 0000000..7e5a44e
+ if not self.__group:
+ return
+ if self.__option:
-+ if self.__current_node == "name":
++ if self.__current_node == 'name':
+ self.__option_label = text
+ if self.__group_label != None and \
+ self.__group_label in self.__optionlist_array:
+ self.__optionlist_array[self.__group_label].append(text)
-+ elif self.__current_node == "description":
++ elif self.__current_node == 'description':
+ self.__option_desc[self.__option_label] = text
+ else:
+ pass
+ else:
-+ if self.__current_node == "name":
++ if self.__current_node == 'name':
+ self.__group_label = text
+ self.__optionlist_array[self.__group_label] = []
-+ elif self.__current_node == "description":
++ elif self.__current_node == 'description':
+ self.__option_group_desc[self.__group_label] = text
+ else:
+ pass
+
+ def startElement(self, name, attrs):
+ self.__current_node = name
-+ if name == "layoutList":
++ if name == 'layoutList':
+ self.__layoutlist = True
-+ elif name == "layout":
++ elif name == 'layout':
+ self.__layout = True
+ self.__layout_label = None
-+ elif name == "variantList":
++ elif name == 'variantList':
+ self.__variantlist = True
-+ elif name == "variant":
++ elif name == 'variant':
+ self.__variant = True
+ self.__variant_label = None
-+ elif name == "optionList":
++ elif name == 'optionList':
+ self.__optionlist = True
-+ elif name == "option":
++ elif name == 'option':
+ self.__option = True
+ self.__option_label = None
-+ elif name == "group":
++ elif name == 'group':
+ self.__group = True
+ self.__group_label = None
+
+ def endElement(self, name):
+ self.__current_node = self.__root
-+ if name == "layoutList":
++ if name == 'layoutList':
+ self.__layoutlist = False
-+ elif name == "layout":
++ elif name == 'layout':
+ self.__layout = False
-+ elif name == "variantList":
++ elif name == 'variantList':
+ self.__variantlist = False
-+ elif name == "variant":
++ elif name == 'variant':
+ self.__variant = False
-+ elif name == "optionList":
++ elif name == 'optionList':
+ self.__optionlist = False
-+ elif name == "option":
++ elif name == 'option':
+ self.__option = False
-+ elif name == "group":
++ elif name == 'group':
+ self.__group = False
+
+ def characters(self, text):
@@ -744,18 +757,18 @@ index 0000000..7e5a44e
+
+ def startElement(self, name, attrs):
+ self.__current_node = name
-+ if name == "xkblayout":
++ if name == 'xkblayout':
+ self.__xkblayout = True
-+ if name == "config":
++ if name == 'config':
+ self.__config = True
+ if self.__downstream != None:
+ self.__downstream.startElement(name, {})
+
+ def endElement(self, name):
+ self.__current_node = self.__root
-+ if name == "xkblayout":
++ if name == 'xkblayout':
+ self.__xkblayout = False
-+ if name == "config":
++ if name == 'config':
+ self.__config = False
+ if self.__downstream != None:
+ self.__downstream.endElement(name)
@@ -765,7 +778,7 @@ index 0000000..7e5a44e
+ return
+ if not self.__xkblayout or not self.__config:
+ return
-+ if self.__current_node == "preload_layouts":
++ if self.__current_node == 'preload_layouts':
+ if self.__preload_layouts == None:
+ self.__preload_layouts = text.split(',')
+ self.__preload_layouts.sort()
@@ -787,7 +800,7 @@ index 0000000..7e5a44e
+ try:
+ parser.parse(f)
+ except SAXParseException:
-+ print "ERROR: invalid file format", file_path
++ print 'ERROR: invalid file format', file_path
+ finally:
+ f.close()
+
@@ -822,39 +835,42 @@ index 0000000..7e5a44e
+ layout,
+ layout_desc=None,
+ variant=None,
-+ variant_desc=None):
++ variant_desc=None,
++ name_prefix='xkb:layout:'):
+ if variant_desc != None:
+ longname = variant_desc
+ elif layout != None and variant != None:
-+ longname = layout + " - " + variant
++ longname = layout + ' - ' + variant
+ elif layout_desc != None:
+ longname = layout_desc
+ else:
+ longname = layout
+ if variant != None:
-+ name = "xkb:layout:" + layout + ":" + variant
-+ desc = "XKB " + layout + "(" + variant + ") keyboard layout"
-+ engine_layout = layout + "(" + variant + ")"
++ name = name_prefix + layout + ':' + variant
++ desc = 'XKB ' + layout + '(' + variant + ') keyboard layout'
++ engine_layout = layout + '(' + variant + ')'
+ else:
-+ name = "xkb:layout:" + layout
-+ desc = "XKB " + layout + " keyboard layout"
++ name = name_prefix + layout
++ desc = 'XKB ' + layout + ' keyboard layout'
+ engine_layout = layout
+
++ icon = 'ibus-engine'
++
+ engine = enginedesc.EngineDesc(name, longname, desc, lang,
-+ "LGPL2.1",
-+ "Takao Fujiwara <takao.fujiwara1@gmail.com>",
-+ "ibus-engine",
++ 'LGPL2.1',
++ 'Takao Fujiwara <takao.fujiwara1@gmail.com>',
++ icon,
+ engine_layout)
+ return engine
+
+class XKBLayoutConfig():
+ def __init__(self,
-+ system_config="@datadir@/ibus/xkb/xkblayoutconfig.xml"):
++ system_config='@datadir@/ibus/xkb/xkblayoutconfig.xml'):
+ self.__user_config = get_user_config_dir()
+ if self.__user_config == None:
-+ self.__user_config = os.environ['HOME'] + "/.config"
++ self.__user_config = os.environ['HOME'] + '/.config'
+ self.__user_config = self.__user_config + \
-+ "/ibus/xkb/xkblayoutconfig.xml"
++ '/ibus/xkb/xkblayoutconfig.xml'
+ self.__system_config = system_config
+ self.__filter_handler = None
+ self.__load()
@@ -876,7 +892,7 @@ index 0000000..7e5a44e
+ try:
+ parser.parse(f)
+ except SAXParseException:
-+ print "ERROR: invalid file format", self.__user_config
++ print 'ERROR: invalid file format', self.__user_config
+ finally:
+ f.close()
+
@@ -910,35 +926,35 @@ index 0000000..7e5a44e
+ variant_desc = xkbconfig.get_variant_desc()
+ for layout in layout_list.keys():
+ if layout not in layout_lang:
-+ print "layout name:", layout, "NO-LANG description:", layout_desc[layout]
++ print 'layout name:', layout, 'NO-LANG description:', layout_desc[layout]
+ continue
+ lang = layout_lang[layout]
-+ print "layout name:", layout, "lang:", lang, "description:", layout_desc[layout]
++ print 'layout name:', layout, 'lang:', lang, 'description:', layout_desc[layout]
+ for variant in layout_list[layout]:
-+ label = "%s(%s)" % (layout, variant)
++ label = '%s(%s)' % (layout, variant)
+ if label in layout_lang:
+ lang = layout_lang[label]
-+ print " variant name:", variant, "lang:", lang, "description:", variant_desc[variant]
++ print ' variant name:', variant, 'lang:', lang, 'description:', variant_desc[variant]
+
+ option_list = xkbconfig.get_option_list()
+ option_group_desc = xkbconfig.get_option_group_desc()
+ option_desc = xkbconfig.get_option_desc()
+ for option_group in option_list.keys():
-+ print "option group name:", option_group, "description:", option_group_desc[option_group]
++ print 'option group name:', option_group, 'description:', option_group_desc[option_group]
+ for option in option_list[option_group]:
-+ print " option name:", option, "description:", option_desc[option]
++ print ' option name:', option, 'description:', option_desc[option]
+
+def test2():
-+ xkblayoutconfig = XKBLayoutConfig("../xkb/xkblayoutconfig.xml")
++ xkblayoutconfig = XKBLayoutConfig('../xkb/xkblayoutconfig.xml')
+ list = xkblayoutconfig.get_preload_layouts()
+ print list
+ if list == None:
+ list = []
-+ list.append("gb(test)")
++ list.append('gb(test)')
+ list.sort()
+ #xkblayoutconfig.save_preload_layouts(list)
+
-+if __name__ == "__main__":
++if __name__ == '__main__':
+ test()
+ test2()
diff --git a/setup/Makefile.am b/setup/Makefile.am
@@ -2146,86 +2162,6 @@ index c408f3d..6bb9ff5 100644
#include <ibusxml.h>
#include <ibusenginedesc.h>
#include <ibusobservedpath.h>
-diff --git a/src/ibusfactory.c b/src/ibusfactory.c
-index 11d9a6d..7770216 100644
---- a/src/ibusfactory.c
-+++ b/src/ibusfactory.c
-@@ -21,6 +21,7 @@
- */
- #include "ibusfactory.h"
- #include "ibusengine.h"
-+#include "ibusmarshalers.h"
- #include "ibusshare.h"
- #include "ibusinternal.h"
-
-@@ -28,6 +29,7 @@
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_FACTORY, IBusFactoryPrivate))
-
- enum {
-+ LOOKUP_ENGINE_NAME,
- LAST_SIGNAL,
- };
-
-@@ -42,6 +44,8 @@ struct _IBusFactoryPrivate {
- GHashTable *engine_table;
- };
-
-+static guint factory_signals[LAST_SIGNAL] = { 0 };
-+
- /* functions prototype */
- static void ibus_factory_destroy (IBusFactory *factory);
- static void ibus_factory_set_property (IBusFactory *engine,
-@@ -113,6 +117,17 @@ ibus_factory_class_init (IBusFactoryClass *class)
- ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml);
-
- g_type_class_add_private (class, sizeof (IBusFactoryPrivate));
-+
-+ factory_signals[LOOKUP_ENGINE_NAME] =
-+ g_signal_new (I_("lookup-engine-name"),
-+ G_TYPE_FROM_CLASS (gobject_class),
-+ G_SIGNAL_RUN_LAST,
-+ G_STRUCT_OFFSET (IBusFactoryClass, lookup_engine_name),
-+ NULL, NULL,
-+ _ibus_marshal_VOID__STRING,
-+ G_TYPE_NONE,
-+ 1,
-+ G_TYPE_STRING);
- }
-
- static void
-@@ -190,8 +205,12 @@ ibus_factory_service_method_call (IBusService *service,
-
- if (g_strcmp0 (method_name, "CreateEngine") == 0) {
- gchar *engine_name = NULL;
-+ GType engine_type;
-+
- g_variant_get (parameters, "(&s)", &engine_name);
-- GType engine_type = (GType )g_hash_table_lookup (factory->priv->engine_table, engine_name);
-+ g_signal_emit (factory, factory_signals[LOOKUP_ENGINE_NAME],
-+ 0, engine_name);
-+ engine_type = (GType) g_hash_table_lookup (factory->priv->engine_table, engine_name);
-
- if (engine_type == G_TYPE_INVALID) {
- gchar *error_message = g_strdup_printf ("Can not fond engine %s", engine_name);
-diff --git a/src/ibusfactory.h b/src/ibusfactory.h
-index 47c06e0..102081c 100644
---- a/src/ibusfactory.h
-+++ b/src/ibusfactory.h
-@@ -127,10 +127,13 @@ struct _IBusFactoryClass {
- IBusServiceClass parent;
-
- /* signals */
-+ void (* lookup_engine_name)
-+ (IBusFactory *factory,
-+ const gchar *engine_name);
-
- /*< private >*/
- /* padding */
-- gpointer pdummy[8];
-+ gpointer pdummy[7];
- };
-
- /**
diff --git a/src/ibusxkbxml.c b/src/ibusxkbxml.c
new file mode 100644
index 0000000..c630eb9
@@ -2851,7 +2787,7 @@ index 0000000..6986b5c
+G_END_DECLS
+#endif
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
-index 90be1d5..de64920 100644
+index 90be1d5..8804634 100644
--- a/ui/gtk/panel.py
+++ b/ui/gtk/panel.py
@@ -132,6 +132,22 @@ class Panel(ibus.PanelBase):
@@ -2928,7 +2864,7 @@ index 90be1d5..de64920 100644
def reset(self):
-@@ -542,3 +572,12 @@ class Panel(ibus.PanelBase):
+@@ -542,3 +572,14 @@ class Panel(ibus.PanelBase):
flags=glib.SPAWN_DO_NOT_REAP_CHILD)[0]
self.__setup_pid = pid
glib.child_watch_add(self.__setup_pid, self.__child_watch_cb)
@@ -2939,6 +2875,8 @@ index 90be1d5..de64920 100644
+ # to "default" layout?
+ if engine.name != None and engine.name.startswith("xkb:layout:"):
+ return engine.layout
++ elif engine.layout != None and engine.layout.startswith("default"):
++ return engine.layout
+ else:
+ return "default"
diff --git a/xkb/Makefile.am b/xkb/Makefile.am
@@ -3053,10 +2991,10 @@ index 0000000..ad9cdd9
+endif
diff --git a/xkb/ibus-engine-xkb-main.c b/xkb/ibus-engine-xkb-main.c
new file mode 100644
-index 0000000..5d748cc
+index 0000000..a2f131c
--- /dev/null
+++ b/xkb/ibus-engine-xkb-main.c
-@@ -0,0 +1,397 @@
+@@ -0,0 +1,413 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* vim:set et sts=4: */
+/* bus - The Input Bus
@@ -3083,7 +3021,6 @@ index 0000000..5d748cc
+#include <config.h>
+#endif
+
-+#include <gconf/gconf-client.h>
+#include <ibus.h>
+#include <stdlib.h>
+
@@ -3210,34 +3147,48 @@ index 0000000..5d748cc
+ ibus_quit ();
+}
+
-+static void
-+_factory_lookup_engine_name_cb (IBusFactory *factory,
-+ const gchar *engine_name,
-+ gpointer data)
++IBusEngine *
++_factory_create_engine_cb (IBusFactory *factory,
++ const gchar *engine_name,
++ gpointer data)
+{
-+ static GList *engine_list = NULL;
-+ GList *list;
-+ gboolean has_name = FALSE;
++#if 0
++ static GHashTable *engine_table = NULL;
++#endif
++ IBusEngine *engine = NULL;
++ gchar *object_path = NULL;
++ static int id = 0;
+
-+ g_return_if_fail (engine_name != NULL);
++ g_return_val_if_fail (engine_name != NULL, NULL);
+
+ if (g_strcmp0 (engine_name, "xkb:layout:us") == 0) {
-+ return;
++ return NULL;
+ }
-+ list = engine_list;
-+ while (list) {
-+ if (g_strcmp0 (list->data, engine_name) == 0) {
-+ has_name = TRUE;
-+ break;
-+ }
-+ list = list->next;
++
++ /* FIXME: Do we always need a new object path for the same engine name? */
++#if 0
++ if (engine_table == NULL) {
++ engine_table = g_hash_table_new_full (g_str_hash,
++ g_str_equal,
++ g_free,
++ NULL);
+ }
-+ if (has_name) {
-+ return;
++
++ if ((engine = (IBusEngine *) g_hash_table_lookup (engine_table,
++ engine_name))) {
++ return engine;
+ }
++#endif
+
-+ ibus_factory_add_engine (factory, engine_name, IBUS_TYPE_XKB_ENGINE);
-+ engine_list = g_list_append (engine_list, (gpointer) g_strdup (engine_name));
++ object_path = g_strdup_printf ("/org/freedesktop/IBus/XKBEngine/%d",
++ ++id);
++ engine = ibus_engine_new (engine_name,
++ object_path,
++ ibus_service_get_connection (IBUS_SERVICE (factory)));
++#if 0
++ g_hash_table_insert (engine_table, g_strdup (engine_name), engine);
++#endif
++ return engine;
+}
+
+static void
@@ -3263,14 +3214,15 @@ index 0000000..5d748cc
+ "us",
+ "USA",
+ NULL,
++ NULL,
+ NULL));
+
+ factory = ibus_factory_new (ibus_bus_get_connection (bus));
+
+ ibus_factory_add_engine (factory, "xkb:layout:us", IBUS_TYPE_XKB_ENGINE);
+
-+ g_signal_connect (G_OBJECT (factory), "lookup-engine-name",
-+ G_CALLBACK (_factory_lookup_engine_name_cb),
++ g_signal_connect (G_OBJECT (factory), "create-engine",
++ G_CALLBACK (_factory_create_engine_cb),
+ NULL);
+ if (ibus) {
+ ibus_bus_request_name (bus, "org.freedesktop.IBus.XKB", 0);
@@ -3370,6 +3322,7 @@ index 0000000..5d748cc
+ (const gchar *) keys->data,
+ desc,
+ NULL,
++ NULL,
+ NULL);
+ ibus_component_add_engine (component, engine);
+ }
@@ -3405,7 +3358,8 @@ index 0000000..5d748cc
+ (const gchar *) keys->data,
+ desc,
+ (const gchar *) variants->data,
-+ (const gchar *) g_hash_table_lookup (variant_desc, variants->data));
++ (const gchar *) g_hash_table_lookup (variant_desc, variants->data),
++ NULL);
+ ibus_component_add_engine (component, engine);
+ }
+ }
@@ -4040,10 +3994,10 @@ index 0000000..15e5d18
+#endif
diff --git a/xkb/xkbxml.c b/xkb/xkbxml.c
new file mode 100644
-index 0000000..2ce7bcf
+index 0000000..ad10c28
--- /dev/null
+++ b/xkb/xkbxml.c
-@@ -0,0 +1,335 @@
+@@ -0,0 +1,339 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* vim:set et sts=4: */
+/* bus - The Input Bus
@@ -4312,7 +4266,8 @@ index 0000000..2ce7bcf
+ const gchar *layout,
+ const gchar *layout_desc,
+ const gchar *variant,
-+ const gchar *variant_desc)
++ const gchar *variant_desc,
++ const gchar *name_prefix)
+{
+ IBusEngineDesc *engine;
+ gchar *name = NULL;
@@ -4322,6 +4277,9 @@ index 0000000..2ce7bcf
+
+ g_return_val_if_fail (lang != NULL && layout != NULL, NULL);
+
++ if (name_prefix == NULL) {
++ name_prefix = "xkb:layout:";
++ }
+ if (variant_desc) {
+ longname = g_strdup (variant_desc);
+ } else if (layout && variant) {
@@ -4332,11 +4290,11 @@ index 0000000..2ce7bcf
+ longname = g_strdup (layout);
+ }
+ if (variant) {
-+ name = g_strdup_printf ("xkb:layout:%s:%s", layout, variant);
++ name = g_strdup_printf ("%s%s:%s", name_prefix, layout, variant);
+ desc = g_strdup_printf ("XKB %s(%s) keyboard layout", layout, variant);
+ engine_layout = g_strdup_printf ("%s(%s)", layout, variant);
+ } else {
-+ name = g_strdup_printf ("xkb:layout:%s", layout);
++ name = g_strdup_printf ("%s%s", name_prefix, layout);
+ desc = g_strdup_printf ("XKB %s keyboard layout", layout);
+ engine_layout = g_strdup (layout);
+ }
@@ -4381,10 +4339,10 @@ index 0000000..2ce7bcf
+}
diff --git a/xkb/xkbxml.h b/xkb/xkbxml.h
new file mode 100644
-index 0000000..56811ef
+index 0000000..6c00f1d
--- /dev/null
+++ b/xkb/xkbxml.h
-@@ -0,0 +1,110 @@
+@@ -0,0 +1,113 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* vim:set et sts=4: */
+/* bus - The Input Bus
@@ -4462,6 +4420,8 @@ index 0000000..56811ef
+ * @layout_desc: Keyboard layout description for engine description
+ * @variant: Keyboard variant
+ * @variant_desc: Keyboard variant description for engine description
++ * @name_prefix: Name prefix for engine description, If NULL,
++ * the default is "xkb:layout:".
+ * @returns: A newly allocated IBusEngineDesc.
+ *
+ * New a IBusEngineDesc.
@@ -4470,7 +4430,8 @@ index 0000000..56811ef
+ const gchar *layout,
+ const gchar *layout_desc,
+ const gchar *variant,
-+ const gchar *variant_desc);
++ const gchar *variant_desc,
++ const gchar *name_prefix);
+
+GType ibus_xkb_layout_config_get_type (void);
+
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index fab6c88..c4b5498 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -1066,3 +1066,272 @@ index 1567c5f..2164e7c 100644
--
1.7.5.4
+From 624c4451da2bd171bd8ac53a9b9dd2a4227ef67f Mon Sep 17 00:00:00 2001
+From: Peng Huang <shawn.p.huang@gmail.com>
+Date: Thu, 7 Jul 2011 12:42:52 -0400
+Subject: [PATCH] Fix several GVariant related issues. And remove a wrong
+ unref.
+
+BUG=None
+TEST=Linux desktop
+
+Review URL: http://codereview.appspot.com/4667067
+---
+ bus/ibusimpl.c | 11 +++++------
+ bus/inputcontext.c | 1 -
+ src/ibusconfig.c | 8 ++------
+ 3 files changed, 7 insertions(+), 13 deletions(-)
+
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index b356b2c..42afeec 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -2183,8 +2183,8 @@ bus_ibus_impl_save_global_engine_name_to_config (BusIBusImpl *ibus)
+ ibus->use_global_engine &&
+ ibus->global_engine_name) {
+ ibus_config_set_value (ibus->config,
+- "general", "global_engine",
+- g_variant_new ("s", ibus->global_engine_name));
++ "general", "global_engine",
++ g_variant_new_string (ibus->global_engine_name));
+ }
+ }
+
+@@ -2206,8 +2206,7 @@ bus_ibus_impl_load_global_previous_engine_name_from_config (BusIBusImpl *ibus)
+ GVariant *value = ibus_config_get_value (ibus->config, "general", "global_previous_engine");
+ if (value == NULL)
+ return NULL;
+- gchar *engine_name = NULL;
+- g_variant_get (value, "(s)", &engine_name);
++ gchar *engine_name = g_variant_dup_string (value, NULL);
+ g_variant_unref (value);
+ return engine_name;
+ }
+@@ -2226,8 +2225,8 @@ bus_ibus_impl_save_global_previous_engine_name_to_config (BusIBusImpl *ibus)
+ ibus->use_global_engine &&
+ ibus->global_previous_engine_name) {
+ ibus_config_set_value (ibus->config,
+- "general", "global_previous_engine",
+- g_variant_new ("s", ibus->global_previous_engine_name));
++ "general", "global_previous_engine",
++ g_variant_new_string (ibus->global_previous_engine_name));
+ }
+ }
+
+diff --git a/bus/inputcontext.c b/bus/inputcontext.c
+index 2164e7c..47ac9d5 100644
+--- a/bus/inputcontext.c
++++ b/bus/inputcontext.c
+@@ -1171,7 +1171,6 @@ bus_input_context_focus_in (BusInputContext *context)
+ NULL, /* we do not cancel the call. */
+ NULL, /* use the default callback function. */
+ NULL);
+- g_object_unref (desc);
+ }
+ }
+
+diff --git a/src/ibusconfig.c b/src/ibusconfig.c
+index 36ef44b..b691277 100644
+--- a/src/ibusconfig.c
++++ b/src/ibusconfig.c
+@@ -191,7 +191,6 @@ ibus_config_get_value (IBusConfig *conf
+
+ GVariant *value = NULL;
+ g_variant_get (result, "(v)", &value);
+- g_variant_ref (value);
+ g_variant_unref (result);
+
+ return value;
+@@ -235,7 +234,6 @@ ibus_config_get_value_async_finish (IBus
+ error);
+ if (retval != NULL) {
+ g_variant_get (retval, "(v)", &value);
+- g_variant_ref (value);
+ g_variant_unref (retval);
+ }
+
+--
+1.7.5.4
+
+From 55a5652ac7d91fb319ef6576500e421eb53e80f4 Mon Sep 17 00:00:00 2001
+From: Yusuke Sato <yusukes@chromium.org>
+Date: Mon, 11 Jul 2011 11:55:19 +0900
+Subject: [PATCH] Remove the callback on destroy.
+
+BUG=crosbug.com/17293
+TEST=src/tests/ibus-bus.c
+
+Review URL: http://codereview.appspot.com/4675074
+---
+ src/ibusbus.c | 4 ++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/ibusbus.c b/src/ibusbus.c
+index 39ad784..2607448 100644
+--- a/src/ibusbus.c
++++ b/src/ibusbus.c
+@@ -398,8 +398,12 @@ ibus_bus_destroy (IBusObject *object)
+ }
+
+ if (bus->priv->connection) {
++ g_signal_handlers_disconnect_by_func (bus->priv->connection,
++ G_CALLBACK (_connection_closed_cb),
++ bus);
+ /* FIXME should use async close function */
+ g_dbus_connection_close_sync (bus->priv->connection, NULL, NULL);
++ g_object_unref (bus->priv->connection);
+ bus->priv->connection = NULL;
+ }
+
+--
+1.7.5.4
+
+From 290a37e1d4e3ec44dfea4b99744520f781c92592 Mon Sep 17 00:00:00 2001
+From: Yusuke Sato <yusukes@chromium.org>
+Date: Tue, 12 Jul 2011 14:04:30 +0900
+Subject: [PATCH] Use g_variant_dup_string for consistency.
+
+This fix is similar to https://github.com/ibus/ibus/commit/624c4451da2bd171bd8ac53a9b9dd2a4227ef67f .
+
+BUG=None
+TEST=None
+
+Review URL: http://codereview.appspot.com/4641101
+---
+ bus/ibusimpl.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index 42afeec..b6b2441 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -2163,7 +2163,7 @@ bus_ibus_impl_load_global_engine_name_from_config (BusIBusImpl *ibus)
+ GVariant *variant = ibus_config_get_value (ibus->config, "general", "global_engine");
+ gchar *engine_name = NULL;
+ if (variant != NULL) {
+- g_variant_get (variant, "s", &engine_name);
++ engine_name = g_variant_dup_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return engine_name;
+--
+1.7.5.4
+
+From 48cc200d7dbe999f92b05507a7c59bea42ac6f1c Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Tue, 12 Jul 2011 15:14:59 +0900
+Subject: [PATCH] Fixed an error in IBus.Bus.register_component
+
+TEST=Linux desktop
+
+Review URL: http://codereview.appspot.com/4668060
+---
+ ibus/component.py | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/ibus/component.py b/ibus/component.py
+index 12f593d..7255ee1 100644
+--- a/ibus/component.py
++++ b/ibus/component.py
+@@ -94,6 +94,11 @@ class Component(Serializable):
+ engine = EngineDesc(name, longname, description, language, license, author, icon, layout, hotkeys)
+ self.__engines.append(engine)
+
++ def add_engines(self, engines):
++ if not isinstance(engines, list):
++ raise TypeError("engines must be an instance of list")
++ self.__engines.extend(engines)
++
+ def serialize(self, struct):
+ super(Component, self).serialize(struct)
+ struct.append (dbus.String(self.__name))
+@@ -106,8 +111,6 @@ class Component(Serializable):
+ struct.append (dbus.String(self.__textdomain))
+ struct.append (dbus.Array(map(serialize_object,self.__observed_paths), signature="v"))
+ struct.append (dbus.Array(map(serialize_object,self.__engines), signature="v"))
+- # New properties of Component will use dict for serialize
+- struct.append(dbus.Array({}, signature=None))
+
+ def deserialize(self, struct):
+ super(Component, self).deserialize(struct)
+@@ -123,8 +126,6 @@ class Component(Serializable):
+
+ self.__observed_paths = map(deserialize_object, struct.pop(0))
+ self.__engines = map(deserialize_object, struct.pop(0))
+- # New properties of Component will use dict for serialize
+- #value = struct.pop(0)
+
+ def test():
+ text = Component("Hello", "", "", "", "", "", "", "")
+--
+1.7.5.4
+
+From 88a44759ce5d3d785c7be96525130c67e8c63e1e Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno@unixuser.org>
+Date: Fri, 15 Jul 2011 09:51:07 +0900
+Subject: [PATCH] Fix GObject ref/unref issues.
+
+BUG=none
+TEST=manual
+
+Review URL: http://codereview.appspot.com/4700048
+---
+ bus/registry.c | 5 +++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bus/registry.c b/bus/registry.c
+index bc6680d..7b74781 100644
+--- a/bus/registry.c
++++ b/bus/registry.c
+@@ -424,7 +424,9 @@ bus_registry_load_in_dir (BusRegistry *registry,
+ if (component != NULL) {
+ BusComponent *buscomp = bus_component_new (component,
+ NULL /* factory */);
+- registry->components = g_list_append (registry->components, buscomp);
++ g_object_ref_sink (buscomp);
++ registry->components =
++ g_list_append (registry->components, buscomp);
+ }
+
+ g_free (path);
+@@ -654,7 +656,6 @@ bus_registry_name_owner_changed (BusRegistry *registry,
+ factory = bus_factory_proxy_new (connection);
+ if (factory == NULL)
+ return;
+- g_object_ref_sink (factory);
+ bus_component_set_factory (component, factory);
+ g_object_unref (factory);
+ }
+--
+1.7.5.4
+
+From 0cb912cfe5664714e612206d955d458532adc707 Mon Sep 17 00:00:00 2001
+From: Peng Huang <shawn.p.huang@gmail.com>
+Date: Sat, 23 Jul 2011 09:23:41 +0800
+Subject: [PATCH] Always enable the new focused BusInputContext
+
+BUG=http://crosbug.com/17013
+TEST=On ChromeOS
+
+Review URL: http://codereview.appspot.com/4816047
+---
+ bus/ibusimpl.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index b6b2441..853465c 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -1203,8 +1203,7 @@ bus_ibus_impl_set_focused_context (BusIBusImpl *ibus,
+ /* attach engine to the focused context */
+ if (engine != NULL) {
+ bus_input_context_set_engine (context, engine);
+- if (bus_engine_proxy_is_enabled (engine))
+- bus_input_context_enable (context);
++ bus_input_context_enable (context);
+ g_object_unref (engine);
+ }
+
+--
+1.7.5.4
+
diff --git a/ibus-xx-bridge-hotkey.patch b/ibus-xx-bridge-hotkey.patch
index 7346ace..0b59020 100644
--- a/ibus-xx-bridge-hotkey.patch
+++ b/ibus-xx-bridge-hotkey.patch
@@ -1,36 +1,46 @@
-From 2ae147c6d4b15b4aa40a915e86d04fb795d3024b Mon Sep 17 00:00:00 2001
+From 9d5387ea430adbce81899a1a2bece6c8520848b1 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 5 Jul 2011 13:51:11 +0900
+Date: Fri, 5 Aug 2011 20:54:37 +0900
Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
of on-off.
---
- bus/Makefile.am | 20 ++-
- bus/ibusimpl.c | 357 ++++++++++++++++++++++++++++++++++++--------
- bus/registry.c | 35 +++++
- configure.ac | 31 ++++
- data/Makefile.am | 6 +-
- data/ibus.schemas.in | 286 -----------------------------------
- data/ibus.schemas.in.in | 286 +++++++++++++++++++++++++++++++++++
- ibus/_config.py.in | 6 +
- ibus/inputcontext.py | 4 +
- setup/enginecombobox.py | 3 +
- setup/enginetreeview.py | 16 ++-
- src/Makefile.am | 18 ++-
- src/ibusbus.c | 12 ++
- src/ibusbus.h | 18 +++
- src/ibushotkey.c | 11 ++
- src/ibushotkey.h | 11 ++
- ui/gtk/panel.py | 189 +++++++++++++++++++++---
- xkb/Makefile.am | 2 +
- xkb/ibus-engine-xkb-main.c | 8 +
- xkb/xkbxml.c | 8 +-
- 20 files changed, 939 insertions(+), 388 deletions(-)
+ bus/Makefile.am | 20 +-
+ bus/ibusimpl.c | 425 +++++++++++++++++++++++++++++++++------
+ bus/inputcontext.c | 39 ++++
+ bus/inputcontext.h | 22 ++
+ bus/registry.c | 36 ++++
+ configure.ac | 31 +++
+ data/Makefile.am | 6 +-
+ data/ibus.schemas.in | 287 --------------------------
+ data/ibus.schemas.in.in | 300 +++++++++++++++++++++++++++
+ ibus/_config.py.in | 6 +
+ ibus/inputcontext.py | 14 ++-
+ ibus/interface/iinputcontext.py | 4 +-
+ ibus/xkbxml.py.in | 4 +
+ setup/enginecombobox.py | 3 +
+ setup/enginetreeview.py | 16 ++-
+ setup/main.py | 24 +++
+ setup/setup.ui | 55 +++++-
+ src/Makefile.am | 18 +-
+ src/ibushotkey.c | 11 +
+ src/ibushotkey.h | 11 +
+ src/ibusutil.c | 12 +
+ src/ibusutil.h | 14 ++
+ ui/gtk/Makefile.am | 2 +
+ ui/gtk/panel.py | 288 ++++++++++++++++++++++++--
+ ui/gtk/xkbengine.py | 93 +++++++++
+ ui/gtk/xkbfactory.py | 117 +++++++++++
+ xkb/Makefile.am | 2 +
+ xkb/xkbxml.c | 10 +-
+ 28 files changed, 1480 insertions(+), 390 deletions(-)
delete mode 100644 data/ibus.schemas.in
create mode 100644 data/ibus.schemas.in.in
+ create mode 100644 ui/gtk/xkbengine.py
+ create mode 100644 ui/gtk/xkbfactory.py
diff --git a/bus/Makefile.am b/bus/Makefile.am
-index b356b2c..f9417ad 100644
+index 074b456..0efaa1b 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -29,15 +29,17 @@ INCLUDES = \
@@ -61,10 +71,10 @@ index b356b2c..f9417ad 100644
AM_LDADD = \
@GOBJECT2_LIBS@ \
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index b356b2c..ffea37a 100644
+index f13d8e0..44fe954 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
-@@ -20,6 +20,10 @@
+@@ -20,12 +20,17 @@
* Boston, MA 02111-1307, USA.
*/
@@ -75,7 +85,14 @@ index b356b2c..ffea37a 100644
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
-@@ -79,6 +83,10 @@ struct _BusIBusImpl {
+ #include <signal.h>
+ #include <locale.h>
+ #include <strings.h>
++#include <string.h>
+ #include "types.h"
+ #include "ibusimpl.h"
+ #include "dbusimpl.h"
+@@ -79,6 +84,10 @@ struct _BusIBusImpl {
/* engine-specific hotkeys */
IBusHotkeyProfile *engines_hotkey_profile;
GHashTable *hotkey_to_engines_map;
@@ -86,7 +103,7 @@ index b356b2c..ffea37a 100644
};
struct _BusIBusImplClass {
-@@ -99,6 +107,8 @@ enum {
+@@ -99,6 +108,8 @@ enum {
static guint _signals[LAST_SIGNAL] = { 0 };
*/
@@ -95,7 +112,7 @@ index b356b2c..ffea37a 100644
/* functions prototype */
static void bus_ibus_impl_destroy (BusIBusImpl *ibus);
static void bus_ibus_impl_service_method_call
-@@ -285,6 +295,30 @@ _panel_destroy_cb (BusPanelProxy *panel,
+@@ -285,6 +296,30 @@ _panel_destroy_cb (BusPanelProxy *panel,
g_object_unref (panel);
}
@@ -126,34 +143,35 @@ index b356b2c..ffea37a 100644
static void
_config_set_value_done (GObject *object,
GAsyncResult *res,
-@@ -475,8 +509,21 @@ _set_preload_engines (BusIBusImpl *ibus,
- g_variant_unref (value);
- }
-
-- g_list_foreach (engine_list, (GFunc) g_object_ref, NULL);
- ibus->engine_list = engine_list;
-+#if USE_BRIDGE_HOTKEY
-+ if (_find_engine_desc_by_name (ibus, DEFAULT_BRIDGE_ENGINE_NAME) == NULL) {
-+ IBusEngineDesc *engine = bus_registry_find_engine_by_name (ibus->registry,
-+ DEFAULT_BRIDGE_ENGINE_NAME);
-+ g_assert (engine != NULL);
-+ if (g_list_length (engine_list) > 0) {
-+ engine_list = g_list_insert (engine_list, engine, 1);
-+ } else {
-+ engine_list = g_list_append (engine_list, engine);
-+ }
-+ ibus->engine_list = engine_list;
-+ }
-+#endif
-+ g_list_foreach (engine_list, (GFunc) g_object_ref, NULL);
-
- if (ibus->engine_list) {
- BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) ibus->engine_list->data);
-@@ -562,6 +609,43 @@ bus_ibus_impl_set_hotkey (BusIBusImpl *i
+@@ -562,6 +597,67 @@ bus_ibus_impl_set_hotkey (BusIBusImpl *i
}
+#if USE_BRIDGE_HOTKEY
++static gboolean
++use_bridge_hotkey (BusIBusImpl *ibus)
++{
++ GVariant *variant = NULL;
++ gboolean _use_bridge_hotkey = TRUE;
++
++ g_assert (ibus != NULL);
++
++ if (!ibus->config) {
++ return TRUE;
++ }
++
++ variant = ibus_config_get_value (ibus->config,
++ "general/hotkey",
++ "use_bridge_hotkey");
++
++ if (variant != NULL) {
++ g_variant_get (variant, "b", &_use_bridge_hotkey);
++ g_variant_unref (variant);
++ }
++
++ return _use_bridge_hotkey;
++}
++
+static void
+bus_ibus_impl_set_bridge_trigger_keys (BusIBusImpl *ibus,
+ GQuark hotkey,
@@ -193,19 +211,23 @@ index b356b2c..ffea37a 100644
/**
* bus_ibus_impl_set_trigger:
*
-@@ -573,7 +657,11 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
+@@ -573,7 +669,15 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
{
GQuark hotkey = g_quark_from_static_string ("trigger");
if (value != NULL) {
+#if USE_BRIDGE_HOTKEY
-+ bus_ibus_impl_set_bridge_trigger_keys (ibus, hotkey, value);
++ if (use_bridge_hotkey (ibus)) {
++ bus_ibus_impl_set_bridge_trigger_keys (ibus, hotkey, value);
++ } else {
++ bus_ibus_impl_set_hotkey (ibus, hotkey, value);
++ }
+#else
bus_ibus_impl_set_hotkey (ibus, hotkey, value);
+#endif
}
#ifndef OS_CHROMEOS
else {
-@@ -1182,28 +1270,110 @@ _ibus_get_address (BusIBusImpl
+@@ -1182,28 +1286,110 @@ _ibus_get_address (BusIBusImpl
g_variant_new ("(s)", bus_server_get_address ()));
}
@@ -333,7 +355,7 @@ index b356b2c..ffea37a 100644
}
/**
-@@ -1216,7 +1386,61 @@ _context_request_engine_cb (BusInputCont
+@@ -1216,7 +1402,71 @@ _context_request_engine_cb (BusInputCont
const gchar *engine_name,
BusIBusImpl *ibus)
{
@@ -347,6 +369,10 @@ index b356b2c..ffea37a 100644
+#if USE_BRIDGE_HOTKEY
+ IBusEngineDesc *current_desc = NULL;
+
++ if (!use_bridge_hotkey (ibus)) {
++ return desc;
++ }
++
+ if (context) {
+ BusEngineProxy *engine = bus_input_context_get_engine (context);
+ if (engine != NULL) {
@@ -355,14 +381,20 @@ index b356b2c..ffea37a 100644
+ }
+
+ if (current_desc) {
-+ ibus->prev_hotkey_engine = current_desc;
++ if (context) {
++ bus_input_context_set_prev_hotkey_engine (context, current_desc);
++ } else {
++ ibus->prev_hotkey_engine = current_desc;
++ }
+ }
+
-+ if (current_desc != NULL && desc != NULL &&
-+ g_strcmp0 (ibus_engine_desc_get_name (current_desc),
-+ ibus_engine_desc_get_name (desc)) != 0 &&
-+ g_strcmp0 (ibus_engine_desc_get_name (desc),
-+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
++ if (((current_desc == NULL && desc != NULL) ||
++ (current_desc != NULL && desc != NULL &&
++ g_strcmp0 (ibus_engine_desc_get_name (current_desc),
++ ibus_engine_desc_get_name (desc)) != 0)) &&
++ g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
++ DEFAULT_BRIDGE_ENGINE_NAME,
++ strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
+ const gchar *hotkeys = NULL;
+
+ /* If the user customized the trigger key, the trigger key is used for
@@ -372,12 +404,12 @@ index b356b2c..ffea37a 100644
+ g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
+
+ hotkeys = (const gchar *) _bridge_trigger_keys;
-+ } else {
++ } else if (current_desc) {
+ hotkeys = ibus_engine_desc_get_hotkeys (current_desc);
+ }
+
-+ /* If engine hotkeys are not defined in the compose xml file, IBus trigger
-+ * keys are used. */
++ /* If engine hotkeys are not defined in the compose xml file,
++ * IBus trigger keys are used. */
+ if (!hotkeys || !*hotkeys) {
+ hotkeys = (const gchar *) _bridge_trigger_keys;
+ }
@@ -396,42 +428,89 @@ index b356b2c..ffea37a 100644
}
/**
-@@ -2353,6 +2577,15 @@ bus_ibus_impl_filter_keyboard_shortcuts
+@@ -2270,6 +2520,9 @@ bus_ibus_impl_filter_keyboard_shortcuts
+
+ GQuark event;
+ GList *engine_list;
++#if USE_BRIDGE_HOTKEY
++ IBusEngineDesc *prev_hotkey_engine = NULL;
++#endif
+
+ if (trigger == 0) {
+ trigger = g_quark_from_static_string ("trigger");
+@@ -2334,6 +2587,12 @@ bus_ibus_impl_filter_keyboard_shortcuts
+ return FALSE;
+ }
+
++#if USE_BRIDGE_HOTKEY
++ if (!use_bridge_hotkey (ibus)) {
++ return FALSE;
++ }
++#endif
++
+ /* Then try engines hotkeys. */
+ event = ibus_hotkey_profile_filter_key_event (ibus->engines_hotkey_profile,
+ keyval,
+@@ -2355,6 +2614,24 @@ bus_ibus_impl_filter_keyboard_shortcuts
g_assert (new_engine_desc);
+#if USE_BRIDGE_HOTKEY
++ if (context) {
++ prev_hotkey_engine = bus_input_context_get_prev_hotkey_engine (context);
++ if (prev_hotkey_engine == NULL && ibus->prev_hotkey_engine) {
++ prev_hotkey_engine = ibus->prev_hotkey_engine;
++ bus_input_context_set_prev_hotkey_engine (context,
++ prev_hotkey_engine);
++ }
++ }
++
+ /* If the previous engine is not included in engine_list,
+ * this enables a new engine instead of toggling the engines
+ * so should not enable the previous engine. */
-+ if (ibus->prev_hotkey_engine &&
-+ g_list_find (engine_list, ibus->prev_hotkey_engine) != NULL) {
-+ new_engine_desc = ibus->prev_hotkey_engine;
++ if (prev_hotkey_engine &&
++ g_list_find (engine_list, prev_hotkey_engine) != NULL) {
++ new_engine_desc = prev_hotkey_engine;
+ }
+#else
/* Find out what engine we should switch to. If the current engine has
* the same hotkey, then we should switch to the next engine with the
* same hotkey in the list. Otherwise, we just switch to the first
-@@ -2364,8 +2597,32 @@ bus_ibus_impl_filter_keyboard_shortcuts
+@@ -2366,8 +2643,47 @@ bus_ibus_impl_filter_keyboard_shortcuts
break;
}
}
+#endif
-
++
+#if USE_BRIDGE_HOTKEY
-+ if (current_engine_desc != new_engine_desc ||
-+ g_strcmp0 (ibus_engine_desc_get_name (new_engine_desc),
-+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
-+ ibus->prev_hotkey_engine = current_engine_desc;
++ if (context == NULL) {
++ return FALSE;
++ }
++
++ /* This means RequestEngine signal might be done but SetEngine signal
++ * has not been done yet by ibus status icon. */
++ if (current_engine_desc == NULL &&
++ !bus_input_context_inited_engine (context)) {
++ return FALSE;
++ }
+
++ if (current_engine_desc != new_engine_desc) {
++ if (current_engine_desc) {
++ if (context) {
++ bus_input_context_set_prev_hotkey_engine (context,
++ current_engine_desc);
++ }
++ }
+
+ /* If the previous engine is not included in engine_list and
+ * the current engine is the defualt bridge engine,
+ * the current engine is also not included in engine_list.
+ * So the engine is added here. */
+ if (current_engine_desc != NULL &&
+ g_list_find (engine_list, current_engine_desc) == NULL &&
-+ g_strcmp0 (ibus_engine_desc_get_name (current_engine_desc),
-+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
++ g_ascii_strncasecmp (ibus_engine_desc_get_name (current_engine_desc),
++ DEFAULT_BRIDGE_ENGINE_NAME,
++ strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
+ engine_list = g_list_append (engine_list, current_engine_desc);
+
+ g_hash_table_steal (ibus->hotkey_to_engines_map,
@@ -445,7 +524,7 @@ index b356b2c..ffea37a 100644
bus_ibus_impl_set_context_engine_from_desc (ibus, context, new_engine_desc);
}
-@@ -2470,59 +2727,39 @@ static void
+@@ -2472,59 +2788,54 @@ static void
_add_engine_hotkey (IBusEngineDesc *engine, BusIBusImpl *ibus)
{
const gchar *hotkeys;
@@ -462,29 +541,13 @@ index b356b2c..ffea37a 100644
return;
}
+- hotkeys = ibus_engine_desc_get_hotkeys (engine);
+-
+- if (!hotkeys || !*hotkeys) {
+#if USE_BRIDGE_HOTKEY
-+ /* If the user customized the trigger key, the trigger key is used for
-+ * any IBus engines. */
-+ if (_bridge_trigger_keys != NULL &&
-+ *_bridge_trigger_keys != '\0' &&
-+ g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
-+
-+ hotkeys = (const gchar *) _bridge_trigger_keys;
-+ } else {
-+ hotkeys = ibus_engine_desc_get_hotkeys (engine);
-+ }
-+#else
- hotkeys = ibus_engine_desc_get_hotkeys (engine);
-+#endif
-
-+#if USE_BRIDGE_HOTKEY
-+ /* If engine hotkeys are not defined in the compose xml file, IBus trigger
-+ * keys are used. */
- if (!hotkeys || !*hotkeys) {
-- return;
-+ hotkeys = (const gchar *) _bridge_trigger_keys;
++ if (!use_bridge_hotkey (ibus)) {
+ return;
}
-+#endif
- hotkey_list = g_strsplit_set (hotkeys, ";,", 0);
-
@@ -502,19 +565,48 @@ index b356b2c..ffea37a 100644
- ibus_hotkey_profile_add_hotkey (ibus->engines_hotkey_profile,
- keyval, modifiers, event);
- }
--
++ /* Do not register hotkeys for the default keymap engines
++ * but register hotkeys for only input-method engines
++ * in 'RegisterComponent' dbus method.
++ * The hotkeys for an activated keymap engine will be registered
++ * in 'SetEngine' dbus method. */
++ if (g_ascii_strncasecmp (ibus_engine_desc_get_name (engine),
++ DEFAULT_BRIDGE_ENGINE_NAME,
++ strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
++ return;
++ }
+
- engine_list = g_hash_table_lookup (ibus->hotkey_to_engines_map,
- GUINT_TO_POINTER (event));
--
++ /* If the user customized the trigger key, the trigger key is used for
++ * any IBus engines. */
++ if (_bridge_trigger_keys != NULL &&
++ *_bridge_trigger_keys != '\0' &&
++ g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
+
- /* As we will rebuild the engines hotkey map whenever an engine was
- * added or removed, we don't need to hold a reference of the engine
- * here. */
- engine_list = g_list_append (engine_list, engine);
--
++ hotkeys = (const gchar *) _bridge_trigger_keys;
++ } else {
++ hotkeys = ibus_engine_desc_get_hotkeys (engine);
++ }
++#else
++ hotkeys = ibus_engine_desc_get_hotkeys (engine);
++#endif
+
- /* We need to steal the value before adding it back, otherwise it will
- * be destroyed. */
- g_hash_table_steal (ibus->hotkey_to_engines_map, GUINT_TO_POINTER (event));
--
++#if USE_BRIDGE_HOTKEY
++ /* If engine hotkeys are not defined in the compose xml file, IBus trigger
++ * keys are used. */
++ if (!hotkeys || !*hotkeys) {
++ hotkeys = (const gchar *) _bridge_trigger_keys;
++ }
++#endif
+
- g_hash_table_insert (ibus->hotkey_to_engines_map,
- GUINT_TO_POINTER (event), engine_list);
+ if (!hotkeys || !*hotkeys) {
@@ -526,8 +618,108 @@ index b356b2c..ffea37a 100644
}
/**
+diff --git a/bus/inputcontext.c b/bus/inputcontext.c
+index 4e8cdc5..43dedc0 100644
+--- a/bus/inputcontext.c
++++ b/bus/inputcontext.c
+@@ -90,6 +90,12 @@ struct _BusInputContext {
+
+ /* incompleted set engine by desc request */
+ SetEngineByDescData *data;
++
++ /* if init engine */
++ gboolean inited_engine;
++
++ /* previous hotkey engine for bridge hotkey mode */
++ IBusEngineDesc *prev_hotkey_engine;
+ };
+
+ struct _BusInputContextClass {
+@@ -647,6 +653,11 @@ bus_input_context_destroy (BusInputContext *context)
+ context->client = NULL;
+ }
+
++ if (context->prev_hotkey_engine) {
++ g_object_unref (context->prev_hotkey_engine);
++ context->prev_hotkey_engine = NULL;
++ }
++
+ IBUS_OBJECT_CLASS (bus_input_context_parent_class)->destroy (IBUS_OBJECT (context));
+ }
+
+@@ -2211,6 +2222,7 @@ bus_input_context_set_engine (BusInputContext *context,
+ }
+ else {
+ gint i;
++ context->inited_engine = TRUE;
+ context->engine = engine;
+ g_object_ref (context->engine);
+
+@@ -2538,3 +2550,30 @@ bus_input_context_get_client (BusInputContext *context)
+ g_assert (BUS_IS_INPUT_CONTEXT (context));
+ return context->client;
+ }
++
++gboolean
++bus_input_context_inited_engine (BusInputContext *context)
++{
++ g_assert (BUS_IS_INPUT_CONTEXT (context));
++ return context->inited_engine;
++}
++
++IBusEngineDesc *
++bus_input_context_get_prev_hotkey_engine (BusInputContext *context)
++{
++ g_assert (BUS_IS_INPUT_CONTEXT (context));
++ return context->prev_hotkey_engine;
++}
++
++void
++bus_input_context_set_prev_hotkey_engine (BusInputContext *context,
++ IBusEngineDesc *desc)
++{
++ g_assert (BUS_IS_INPUT_CONTEXT (context));
++ g_assert (desc == NULL || IBUS_IS_ENGINE_DESC (desc));
++
++ if (context->prev_hotkey_engine) {
++ g_object_unref (context->prev_hotkey_engine);
++ }
++ context->prev_hotkey_engine = desc ? g_object_ref (desc) : NULL;
++}
+diff --git a/bus/inputcontext.h b/bus/inputcontext.h
+index bc4e096..c79e033 100644
+--- a/bus/inputcontext.h
++++ b/bus/inputcontext.h
+@@ -213,5 +213,27 @@ void bus_input_context_set_capabilities (BusInputContext *con
+ */
+ const gchar *bus_input_context_get_client (BusInputContext *context);
+
++/**
++ * bus_input_context_inited_engine:
++ * @returns: context->inited_engine.
++ */
++gboolean bus_input_context_inited_engine
++ (BusInputContext *context);
++
++/**
++ * bus_input_context_get_prev_hotkey_engine:
++ * @returns: context->prev_hotkey_engine.
++ */
++IBusEngineDesc *bus_input_context_get_prev_hotkey_engine
++ (BusInputContext *context);
++
++/**
++ * bus_input_context_set_prev_hotkey_engine:
++ * @desc: Assign the desc to context->prev_hotkey_engine.
++ */
++void bus_input_context_set_prev_hotkey_engine
++ (BusInputContext *context,
++ IBusEngineDesc *desc);
++
+ G_END_DECLS
+ #endif
diff --git a/bus/registry.c b/bus/registry.c
-index bc6680d..f47f727 100644
+index 7b74781..07e9148 100644
--- a/bus/registry.c
+++ b/bus/registry.c
@@ -19,6 +19,11 @@
@@ -552,13 +744,14 @@ index bc6680d..f47f727 100644
#ifdef G_THREADS_ENABLED
/* If glib supports thread, we'll create a thread to monitor changes in IME
-@@ -145,12 +153,39 @@ bus_registry_init (BusRegistry *registry)
+@@ -145,12 +153,40 @@ bus_registry_init (BusRegistry *registry)
GList *p1;
for (p1 = engines; p1 != NULL; p1 = p1->next) {
IBusEngineDesc *desc = (IBusEngineDesc *) p1->data;
+#if USE_BRIDGE_HOTKEY
-+ if (g_strcmp0 (ibus_engine_desc_get_name (desc),
-+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
++ if (g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
++ DEFAULT_BRIDGE_ENGINE_NAME,
++ strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
+ has_default_engine = TRUE;
+ }
+#endif
@@ -593,10 +786,10 @@ index bc6680d..f47f727 100644
static void
diff --git a/configure.ac b/configure.ac
-index 85e5e30..3ada2f8 100644
+index 4c20ae7..21d35c3 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -438,6 +438,34 @@ else
+@@ -456,6 +456,34 @@ else
enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
fi
@@ -622,16 +815,16 @@ index 85e5e30..3ada2f8 100644
+# define default bridge engine name
+AC_ARG_WITH(bridge-engine,
+ AS_HELP_STRING([--with-bridge-engine[=bridge_engine_name]],
-+ [Set bridge engine name in IM bridge hotkey. (default: xkb:layout:default)]),
++ [Set bridge engine name in IM bridge hotkey. (default: xkb:layout:default:)]),
+ [DEFAULT_BRIDGE_ENGINE_NAME=$with_bridge_engine],
-+ [DEFAULT_BRIDGE_ENGINE_NAME="xkb:layout:default"]
++ [DEFAULT_BRIDGE_ENGINE_NAME="xkb:layout:default:"]
+)
+AC_SUBST(DEFAULT_BRIDGE_ENGINE_NAME)
+
# check iso-codes
PKG_CHECK_MODULES(ISOCODES, [
iso-codes
-@@ -464,6 +492,7 @@ bus/Makefile
+@@ -482,6 +510,7 @@ bus/Makefile
util/Makefile
util/IMdkit/Makefile
data/Makefile
@@ -639,7 +832,7 @@ index 85e5e30..3ada2f8 100644
data/icons/Makefile
data/keymaps/Makefile
docs/Makefile
-@@ -512,5 +541,7 @@ Build options:
+@@ -534,5 +563,7 @@ Build options:
No snooper regexes "$NO_SNOOPER_APPS"
Panel icon "$IBUS_ICON_KEYBOARD"
Enable surrounding-text $enable_surrounding_text
@@ -648,10 +841,10 @@ index 85e5e30..3ada2f8 100644
])
diff --git a/data/Makefile.am b/data/Makefile.am
-index ba9f4bb..a909e5b 100644
+index 99be41c..824da76 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
-@@ -26,7 +26,8 @@ SUBDIRS = \
+@@ -30,7 +30,8 @@ SUBDIRS = \
$(NULL)
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
@@ -661,7 +854,7 @@ index ba9f4bb..a909e5b 100644
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
-@@ -41,11 +42,12 @@ if GCONF_SCHEMAS_INSTALL
+@@ -45,11 +46,12 @@ if GCONF_SCHEMAS_INSTALL
endif
EXTRA_DIST = \
@@ -711,7 +904,7 @@ index a830136..4c3c980 100644
+DEFAULT_BRIDGE_ENGINE_NAME='@DEFAULT_BRIDGE_ENGINE_NAME@'
ISOCODES_PREFIX='@ISOCODES_PREFIX@'
diff --git a/ibus/inputcontext.py b/ibus/inputcontext.py
-index ceeb56d..2694fa3 100644
+index ceeb56d..b3c2f65 100644
--- a/ibus/inputcontext.py
+++ b/ibus/inputcontext.py
@@ -28,6 +28,7 @@ import sys
@@ -722,18 +915,66 @@ index ceeb56d..2694fa3 100644
import object
import common
import serializable
-@@ -282,6 +283,9 @@ class InputContext(object.Object):
- def set_engine(self, engine):
- return self.__context.SetEngine(engine.name)
+@@ -279,8 +280,19 @@ class InputContext(object.Object):
+ except:
+ return None
++ def __handle_ic_reply(self):
++ pass
++
++ def __handle_ic_error(self, e):
++ print self.__gtype_name__, str(e)
++
+ def set_engine(self, engine):
+- return self.__context.SetEngine(engine.name)
++ return self.__context.SetEngine(engine.name,
++ reply_handler=self.__handle_ic_reply,
++ error_handler=self.__handle_ic_error)
++
+ def set_bridge_engine(self):
+ return self.__context.SetEngine(_config.DEFAULT_BRIDGE_ENGINE_NAME)
-+
+
def introspect(self):
return self.__context.Introspect()
+diff --git a/ibus/interface/iinputcontext.py b/ibus/interface/iinputcontext.py
+index 1d3cd2a..58d75e5 100644
+--- a/ibus/interface/iinputcontext.py
++++ b/ibus/interface/iinputcontext.py
+@@ -76,8 +76,8 @@ class IInputContext(dbus.service.Object):
+ @method(out_signature="v")
+ def GetEngine(self): pass
+
+- @method(in_signature="s")
+- def SetEngine(self, engine_name): pass
++ @async_method(in_signature="s")
++ def SetEngine(self, engine_name, reply_cb, error_cb): pass
+ @method()
+ def Destroy(self): pass
+diff --git a/ibus/xkbxml.py.in b/ibus/xkbxml.py.in
+index 16f47df..85d0651 100644
+--- a/ibus/xkbxml.py.in
++++ b/ibus/xkbxml.py.in
+@@ -33,6 +33,8 @@ import enginedesc
+ from xml.sax.saxutils import XMLFilterBase, XMLGenerator
+ from xml.sax._exceptions import SAXParseException
+ from cStringIO import StringIO
++from _config import DEFAULT_BRIDGE_ENGINE_NAME
++from _config import get_ICON_KEYBOARD
+
+ try:
+ from glib import get_user_config_dir
+@@ -312,6 +314,8 @@ class XKBConfigRegistry():
+ engine_layout = layout
+
+ icon = 'ibus-engine'
++ if name_prefix == DEFAULT_BRIDGE_ENGINE_NAME:
++ icon = get_ICON_KEYBOARD()
+
+ engine = enginedesc.EngineDesc(name, longname, desc, lang,
+ 'LGPL2.1',
diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
-index 7383177..247facc 100644
+index 7383177..d35757d 100644
--- a/setup/enginecombobox.py
+++ b/setup/enginecombobox.py
@@ -64,6 +64,9 @@ class EngineComboBox(gtk.ComboBox):
@@ -741,13 +982,13 @@ index 7383177..247facc 100644
lang = {}
for e in engines:
+ if ibus.use_bridge_hotkey() and \
-+ e.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ continue
l = ibus.get_language_name(e.language)
if l not in lang:
lang[l] = []
diff --git a/setup/enginetreeview.py b/setup/enginetreeview.py
-index f620361..0e50ad5 100644
+index f620361..20cde3b 100644
--- a/setup/enginetreeview.py
+++ b/setup/enginetreeview.py
@@ -162,6 +162,14 @@ class EngineTreeView(gtk.TreeView):
@@ -756,7 +997,7 @@ index f620361..0e50ad5 100644
engines = [ r[0] for r in self.__model if r[0] != None]
+ for i, e in enumerate(self.__engines):
+ if ibus.use_bridge_hotkey() and \
-+ e.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ if i < len(engines):
+ engines.insert(i, e)
+ else:
@@ -772,7 +1013,7 @@ index f620361..0e50ad5 100644
- iter = self.__model.append(None)
- self.__model.set(iter, 0, e)
+ if ibus.use_bridge_hotkey() and \
-+ e.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ pass
+ else:
+ iter = self.__model.append(None)
@@ -780,6 +1021,121 @@ index f620361..0e50ad5 100644
self.__engines.add(e)
self.__emit_changed()
+diff --git a/setup/main.py b/setup/main.py
+index 7f4a040..a22ac78 100644
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -213,6 +213,25 @@ class Setup(object):
+ self.__config.get_value("general", "use_global_engine", False))
+ self.__checkbutton_use_global_engine.connect("toggled", self.__checkbutton_use_global_engine_toggled_cb)
+
++ # hotkey settings
++ if ibus.use_bridge_hotkey():
++ label = self.__builder.get_object("label_trigger_hotkey")
++ label.set_label(_("Toggle:"))
++ label.set_tooltip_text(_("The trigger shortcut keys to toggle "
++ "the previous and next input methods"))
++ self.__checkbutton_use_on_off_hotkey = \
++ self.__builder.get_object("checkbutton_use_on_off_hotkey")
++ self.__checkbutton_use_on_off_hotkey.set_active(
++ not self.__config.get_value("general/hotkey",
++ "use_bridge_hotkey",
++ True))
++ self.__checkbutton_use_on_off_hotkey.connect("toggled",
++ self.__checkbutton_use_on_off_hotkey_cb)
++ else:
++ checkbutton = self.__builder.get_object("checkbutton_use_on_off_hotkey")
++ checkbutton.hide()
++ checkbutton.set_no_show_all(True)
++
+ # init engine page
+ preload_engine_mode = self.__config.get_value("general",
+ "preload_engine_mode",
+@@ -519,6 +538,11 @@ class Setup(object):
+ value = self.__checkbutton_use_global_engine.get_active()
+ self.__config.set_value("general", "use_global_engine", value)
+
++ def __checkbutton_use_on_off_hotkey_cb(self, button):
++ value = self.__checkbutton_use_on_off_hotkey.get_active()
++ self.__config.set_value("general/hotkey", "use_bridge_hotkey",
++ not value)
++
+ def __config_value_changed_cb(self, bus, section, name, value):
+ if section == 'general' and name == 'preload_engines':
+ engines = self.__get_engine_descs_from_names(value)
+diff --git a/setup/setup.ui b/setup/setup.ui
+index f1e6d0b..77714a7 100644
+--- a/setup/setup.ui
++++ b/setup/setup.ui
+@@ -232,7 +232,7 @@
+ </packing>
+ </child>
+ <child>
+- <object class="GtkLabel" id="label7">
++ <object class="GtkLabel" id="label_trigger_hotkey">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">The shortcut keys for turning input method on or off</property>
+ <property name="xalign">0</property>
+@@ -962,6 +962,59 @@ You may use up/down buttons to change it.</i></small></property>
+ <property name="position">1</property>
+ </packing>
+ </child>
++ <child>
++ <object class="GtkFrame" id="frame6">
++ <property name="visible">True</property>
++ <property name="label_xalign">0</property>
++ <property name="shadow_type">none</property>
++ <child>
++ <object class="GtkAlignment" id="alignment14">
++ <property name="visible">True</property>
++ <property name="left_padding">12</property>
++ <child>
++ <object class="GtkAlignment" id="alignment15">
++ <property name="visible">True</property>
++ <property name="top_padding">6</property>
++ <property name="left_padding">12</property>
++ <child>
++ <object class="GtkVBox" id="vbox10">
++ <property name="visible">True</property>
++ <property name="orientation">vertical</property>
++ <property name="spacing">6</property>
++ <child>
++ <object class="GtkCheckButton" id="checkbutton_use_on_off_hotkey">
++ <property name="label" translatable="yes">Use trigger keys to enable or disable an input method</property>
++ <property name="visible">True</property>
++ <property name="can_focus">True</property>
++ <property name="receives_default">False</property>
++ <property name="draw_indicator">True</property>
++ </object>
++ <packing>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="position">0</property>
++ </packing>
++ </child>
++ </object>
++ </child>
++ </object>
++ </child>
++ </object>
++ </child>
++ <child type="label">
++ <object class="GtkLabel" id="label50">
++ <property name="visible">True</property>
++ <property name="label" translatable="yes"><b>Hot keys setting</b></property>
++ <property name="use_markup">True</property>
++ </object>
++ </child>
++ </object>
++ <packing>
++ <property name="expand">False</property>
++ <property name="fill">False</property>
++ <property name="position">2</property>
++ </packing>
++ </child>
+ </object>
+ </child>
+ </object>
diff --git a/src/Makefile.am b/src/Makefile.am
index 6454522..319df3c 100644
--- a/src/Makefile.am
@@ -809,54 +1165,6 @@ index 6454522..319df3c 100644
$(NULL)
# ibus library
-diff --git a/src/ibusbus.c b/src/ibusbus.c
-index 39ad784..abc4331 100644
---- a/src/ibusbus.c
-+++ b/src/ibusbus.c
-@@ -1902,3 +1902,15 @@ ibus_bus_call_async (IBusBus *bus,
- (GAsyncReadyCallback) ibus_bus_call_async_done,
- simple);
- }
-+
-+gboolean
-+ibus_bus_use_bridge_hotkey (IBusBus *bus)
-+{
-+ return (USE_BRIDGE_HOTKEY == 1) ? TRUE : FALSE;
-+}
-+
-+gchar *
-+ibus_bus_get_default_bridge_engine_name (IBusBus *bus)
-+{
-+ return g_strdup (DEFAULT_BRIDGE_ENGINE_NAME);
-+}
-diff --git a/src/ibusbus.h b/src/ibusbus.h
-index 77d3916..f560671 100644
---- a/src/ibusbus.h
-+++ b/src/ibusbus.h
-@@ -971,5 +971,23 @@ void ibus_bus_set_watch_ibus_signal
- */
- IBusConfig *ibus_bus_get_config (IBusBus *bus);
-
-+/**
-+ * ibus_bus_use_bridge_hotkey:
-+ * @bus: An #IBusBus.
-+ * @returns: %TRUE if @bus use bridge hotkey, %FALSE otherwise.
-+ *
-+ * Return %TRUE if @bus use bridge hotkey.
-+ */
-+gboolean ibus_bus_use_bridge_hotkey (IBusBus *bus);
-+
-+/**
-+ * ibus_bus_get_default_bridge_engine_name:
-+ * @bus: An #IBusBus.
-+ * @returns: A default bridge engine name.
-+ *
-+ * Return A default bridge engine name. Need to be freed.
-+ */
-+gchar *ibus_bus_get_default_bridge_engine_name (IBusBus *bus);
-+
- G_END_DECLS
- #endif
diff --git a/src/ibushotkey.c b/src/ibushotkey.c
index 32f8338..bef7dfc 100644
--- a/src/ibushotkey.c
@@ -897,8 +1205,64 @@ index 9a341f6..92ec6af 100644
+
G_END_DECLS
#endif
+diff --git a/src/ibusutil.c b/src/ibusutil.c
+index ddb6b9e..46dab1a 100644
+--- a/src/ibusutil.c
++++ b/src/ibusutil.c
+@@ -145,3 +145,15 @@ ibus_get_language_name(const gchar *_locale) {
+ }
+ return retval;
+ }
++
++gboolean
++ibus_use_bridge_hotkey (void)
++{
++ return (USE_BRIDGE_HOTKEY == 1) ? TRUE : FALSE;
++}
++
++const gchar *
++ibus_get_default_bridge_engine_name (void)
++{
++ return DEFAULT_BRIDGE_ENGINE_NAME;
++}
+diff --git a/src/ibusutil.h b/src/ibusutil.h
+index 7cf1995..a19d16e 100644
+--- a/src/ibusutil.h
++++ b/src/ibusutil.h
+@@ -43,4 +43,18 @@
+ */
+ const gchar * ibus_get_language_name (const gchar *_locale);
+
++/**
++ * ibus_bus_use_bridge_hotkey:
++ * @bus: An #IBusBus.
++ * @returns: %TRUE if @bus use bridge hotkey, %FALSE otherwise.
++ */
++gboolean ibus_use_bridge_hotkey (void);
++
++/**
++ * ibus_bus_get_default_bridge_engine_name:
++ * @bus: An #IBusBus.
++ * @returns: A default bridge engine name.
++ */
++const gchar * ibus_get_default_bridge_engine_name (void);
++
+ #endif
+diff --git a/ui/gtk/Makefile.am b/ui/gtk/Makefile.am
+index 1f19748..1702613 100644
+--- a/ui/gtk/Makefile.am
++++ b/ui/gtk/Makefile.am
+@@ -33,6 +33,8 @@ ui_gtk_PYTHON = \
+ propitem.py \
+ toolitem.py \
+ engineabout.py \
++ xkbengine.py \
++ xkbfactory.py \
+ $(NULL)
+ ui_gtkdir = $(pkgdatadir)/ui/gtk
+
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
-index de64920..55acd5a 100644
+index 8804634..d87c1d2 100644
--- a/ui/gtk/panel.py
+++ b/ui/gtk/panel.py
@@ -133,6 +133,15 @@ class Panel(ibus.PanelBase):
@@ -936,11 +1300,19 @@ index de64920..55acd5a 100644
def set_cursor_location(self, x, y, w, h):
self.__candidate_panel.set_cursor_location(x, y, w, h)
-@@ -233,12 +249,69 @@ class Panel(ibus.PanelBase):
+@@ -233,12 +249,113 @@ class Panel(ibus.PanelBase):
def __set_im_name(self, name):
self.__language_bar.set_im_name(name)
-+ def __set_default_layout_engine(self):
++ def __use_bridge_hotkey(self):
++ if not ibus.use_bridge_hotkey():
++ return False
++ if self.__config == None:
++ return True
++ return self.__config.get_value("general/hotkey", "use_bridge_hotkey",
++ True)
++
++ def __set_default_layout_engine(self, use_bridge_hotkey):
+ default_layout = self.__default_layout
+ default_model = self.__default_model
+ if default_layout == 'default':
@@ -975,13 +1347,48 @@ index de64920..55acd5a 100644
+ layout,
+ _("Default Layout"),
+ model,
-+ model_desc)
++ model_desc,
++ ibus.DEFAULT_BRIDGE_ENGINE_NAME)
+ self.__disabled_engines.append(engine)
+ self.__disabled_engines_id = self.__xkblayout.get_group()
-+ if self.__focus_ic == None:
++ if not use_bridge_hotkey:
++ return
++ if self.__disabled_engines != None and self.__disabled_engines != []:
++ component = ibus.Component("org.freedesktop.IBus.XKB",
++ _("XKB Component"),
++ "1.0",
++ "GPL",
++ "Takao Fujiwara",
++ "https://github.com/fujiwarat/ibus/tree/gjs")
++ for engine in self.__disabled_engines:
++ component.add_engine(engine.name,
++ engine.longname,
++ engine.description,
++ engine.language,
++ engine.license,
++ engine.author,
++ engine.icon,
++ engine.layout,
++ engine.hotkeys)
++
++ import xkbfactory
++ self.__factory = xkbfactory.EngineFactory(self.__bus)
++ self.__bus.register_component(component)
++ if not use_bridge_hotkey:
+ return
-+ if not self.__focus_ic.is_enabled():
-+ self.__focus_ic.set_bridge_engine()
++ if self.__disabled_engines != None and self.__disabled_engines != []:
++ if self.__focus_ic == None:
++ return
++ engine = self.__focus_ic.get_engine()
++ if engine == None:
++ if self.__disabled_engines_id < 0:
++ self.__disabled_engines_id = 0
++ self.__focus_ic.focus_in()
++ self.__focus_ic.set_engine(self.__disabled_engines[self.__disabled_engines_id])
++ elif engine != None and \
++ not self.__focus_ic.is_enabled():
++ self.__focus_ic.focus_in()
++ self.__focus_ic.enable()
+
def focus_in(self, ic):
self.reset()
@@ -989,14 +1396,15 @@ index de64920..55acd5a 100644
enabled = self.__focus_ic.is_enabled()
- self.__language_bar.set_enabled(enabled)
-+ if ibus.use_bridge_hotkey():
-+ self.__set_default_layout_engine()
++ use_bridge_hotkey = self.__use_bridge_hotkey()
++ self.__set_default_layout_engine(use_bridge_hotkey)
++ if use_bridge_hotkey:
+ if self.__show != 1:
+ self.__language_bar.set_enabled(enabled)
+ elif enabled:
+ engine = self.__focus_ic.get_engine()
+ if engine != None and \
-+ engine.name != ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ self.__language_bar.set_enabled(enabled)
+ else:
+ self.__language_bar.set_enabled(False)
@@ -1007,7 +1415,7 @@ index de64920..55acd5a 100644
if not enabled:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -250,7 +323,7 @@ class Panel(ibus.PanelBase):
+@@ -250,7 +367,7 @@ class Panel(ibus.PanelBase):
self.__set_im_icon(engine.icon)
self.__set_im_name(engine.longname)
if self.__bus.get_use_sys_layout():
@@ -1016,19 +1424,28 @@ index de64920..55acd5a 100644
else:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -273,7 +346,21 @@ class Panel(ibus.PanelBase):
+@@ -260,6 +377,8 @@ class Panel(ibus.PanelBase):
+
+ def focus_out(self, ic):
+ self.reset()
++ if self.__focus_ic and self.__focus_ic.is_enabled():
++ self.__focus_ic.disable()
+ self.__focus_ic = None
+ self.__language_bar.set_enabled(False)
+ self.__language_bar.focus_out()
+@@ -273,7 +392,21 @@ class Panel(ibus.PanelBase):
return
enabled = self.__focus_ic.is_enabled()
- self.__language_bar.set_enabled(enabled)
+
-+ if ibus.use_bridge_hotkey():
++ if self.__use_bridge_hotkey():
+ if self.__show != 1:
+ self.__language_bar.set_enabled(enabled)
+ elif enabled:
+ engine = self.__focus_ic.get_engine()
+ if engine != None and \
-+ engine.name != ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ self.__language_bar.set_enabled(enabled)
+ else:
+ self.__language_bar.set_enabled(False)
@@ -1039,7 +1456,7 @@ index de64920..55acd5a 100644
if enabled == False:
self.reset()
-@@ -287,7 +374,7 @@ class Panel(ibus.PanelBase):
+@@ -287,7 +420,7 @@ class Panel(ibus.PanelBase):
self.__set_im_icon(engine.icon)
self.__set_im_name(engine.longname)
if self.__bus.get_use_sys_layout():
@@ -1048,7 +1465,7 @@ index de64920..55acd5a 100644
else:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -315,6 +402,7 @@ class Panel(ibus.PanelBase):
+@@ -315,6 +448,7 @@ class Panel(ibus.PanelBase):
def __config_load_show(self):
show = self.__config.get_value("panel", "show", 0)
@@ -1056,7 +1473,7 @@ index de64920..55acd5a 100644
self.__language_bar.set_show(show)
def __config_load_position(self):
-@@ -443,6 +531,21 @@ class Panel(ibus.PanelBase):
+@@ -443,6 +577,21 @@ class Panel(ibus.PanelBase):
# menu.set_take_focus(False)
# return menu
@@ -1078,7 +1495,7 @@ index de64920..55acd5a 100644
def __create_im_menu(self):
engines = self.__bus.list_active_engines()
current_engine = \
-@@ -453,25 +556,31 @@ class Panel(ibus.PanelBase):
+@@ -453,25 +602,34 @@ class Panel(ibus.PanelBase):
size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
menu = gtk.Menu()
for i, engine in enumerate(engines):
@@ -1094,18 +1511,21 @@ index de64920..55acd5a 100644
- item.set_image(_icon.IconWidget(ICON_ENGINE, size[0]))
- item.connect("activate", self.__im_menu_item_activate_cb, engine)
- menu.add(item)
-+ if ibus.use_bridge_hotkey() and \
-+ engine.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME and \
++ if self.__use_bridge_hotkey() and \
++ engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME) and \
+ self.__disabled_engines != None:
++ engine.is_bridge = True
++ engine.disabled_engines_id = 0
+ for j, kb_engine in enumerate(self.__disabled_engines):
-+ kb_engine.is_bridge = True
-+ kb_engine.disabled_engines_id = j
-+ is_bold = True if (current_engine != None and \
-+ current_engine.name == engine.name and \
-+ j == self.__disabled_engines_id) else False
-+ self.__add_engine_in_menu(menu, kb_engine,
-+ is_bold,
-+ size)
++ if engine.name == kb_engine.name:
++ engine.disabled_engines_id = j
++ break
++ is_bold = True if (current_engine != None and \
++ current_engine.name == engine.name and \
++ j == self.__disabled_engines_id) else False
++ self.__add_engine_in_menu(menu, engine,
++ is_bold,
++ size)
+ continue
+ engine.is_bridge = False
+ is_bold = True if (current_engine != None and \
@@ -1118,30 +1538,30 @@ index de64920..55acd5a 100644
if self.__focus_ic == None or not self.__focus_ic.is_enabled():
item.set_sensitive(False)
- menu.add(item)
-+ if not ibus.use_bridge_hotkey():
++ if not self.__use_bridge_hotkey():
+ menu.add(item)
menu.show_all()
menu.set_take_focus(False)
-@@ -523,8 +632,25 @@ class Panel(ibus.PanelBase):
+@@ -523,8 +681,25 @@ class Panel(ibus.PanelBase):
if not self.__focus_ic:
return
if engine:
- self.__focus_ic.set_engine(engine)
-+ if ibus.use_bridge_hotkey() and engine.is_bridge:
++ if self.__use_bridge_hotkey() and engine.is_bridge:
+ engines = self.__bus.list_active_engines()
+ current_engine = \
+ (self.__focus_ic != None and self.__focus_ic.get_engine()) or \
+ (engines and engines[0]) or \
+ None
+ if current_engine and \
-+ current_engine.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ current_engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ self.__disabled_engines_prev_id = self.__disabled_engines_id
+ self.__disabled_engines_swapped = 0
+ else:
+ self.__disabled_engines_prev_id = -1
+ self.__disabled_engines_id = engine.disabled_engines_id
-+ self.__focus_ic.set_bridge_engine()
++ self.__focus_ic.set_engine(self.__disabled_engines[self.__disabled_engines_id])
+ else:
+ self.__disabled_engines_prev_id = -1
+ self.__focus_ic.set_engine(engine)
@@ -1150,25 +1570,73 @@ index de64920..55acd5a 100644
self.__focus_ic.disable()
def __sys_menu_item_activate_cb(self, item, command):
-@@ -573,11 +699,34 @@ class Panel(ibus.PanelBase):
+@@ -573,12 +748,85 @@ class Panel(ibus.PanelBase):
self.__setup_pid = pid
glib.child_watch_add(self.__setup_pid, self.__child_watch_cb)
- def __engine_get_layout_wrapper(self, engine):
++ def __get_model_from_layout(self, layout):
++ left_bracket = layout.find('(')
++ right_bracket = layout.find(')')
++ if left_bracket >= 0 and right_bracket > left_bracket:
++ return (layout[:left_bracket] + layout[right_bracket + 1:], \
++ layout[left_bracket + 1:right_bracket])
++ return (layout, "default")
++
++ def __get_option_from_layout(self, layout):
++ left_bracket = layout.find('[')
++ right_bracket = layout.find(']')
++ if left_bracket >= 0 and right_bracket > left_bracket:
++ return (layout[:left_bracket] + layout[right_bracket + 1:], \
++ layout[left_bracket + 1:right_bracket])
++ return (layout, "default")
++
++ def __merge_models_and_options(self, cur_layout, engine_layout):
++ orig_layout = cur_layout
++ engine_model = "default"
++ engine_option = "default"
++ (engine_layout, engine_model) = \
++ self.__get_model_from_layout(engine_layout)
++ (engine_layout, engine_option) = \
++ self.__get_option_from_layout(engine_layout)
++ if (engine_model == None or engine_model == "default") and \
++ (engine_option == None or engine_option == "default"):
++ return cur_layout
++ cur_model = "default"
++ cur_option = "default"
++ (cur_layout, cur_model) = \
++ self.__get_model_from_layout(cur_layout)
++ (cur_layout, cur_option) = \
++ self.__get_option_from_layout(cur_layout)
++ # Currently implemented options only.
++ # Merging layouts and models are a little complicated.
++ # e.g. ja,ru + ja(kana) == ja,ru,ja(,,kana)
++ if engine_option != None and engine_option != "default":
++ if cur_option == None or cur_option == "default":
++ cur_option = engine_option
++ elif cur_option != None and cur_option != "default":
++ cur_option = "%s,%s" % (cur_option, engine_option)
++ if cur_model != None and cur_model != "default":
++ cur_layout = "%s(%s)" % (cur_layout, cur_model)
++ if cur_option != None and cur_option != "default":
++ cur_layout = "%s[%s]" % (cur_layout, cur_option)
++ return cur_layout
++ return orig_layout
++
+ def __engine_get_layout_wrapper(self, engine, changed_state):
# This code is for the back compatibility.
# Should we remove the codes after all IM engines are changed
# to "default" layout?
- if engine.name != None and engine.name.startswith("xkb:layout:"):
+ if engine.name != None and engine.name.startswith("xkb:layout:") and \
-+ not ibus.use_bridge_hotkey():
++ not self.__use_bridge_hotkey():
+ return engine.layout
+ elif engine.name != None and \
+ engine.name.startswith("xkb:layout:") and \
-+ ibus.use_bridge_hotkey() and \
-+ engine.name != ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ self.__use_bridge_hotkey() and \
++ not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
return engine.layout
-+ elif ibus.use_bridge_hotkey() and \
++ elif self.__use_bridge_hotkey() and \
+ self.__disabled_engines_id >= 0 and \
+ self.__disabled_engines != None and \
+ self.__disabled_engines_id < len(self.__disabled_engines):
@@ -1184,9 +1652,234 @@ index de64920..55acd5a 100644
+ self.__disabled_engines_id = x
+ self.__disabled_engines_swapped = 1
+ retval = self.__disabled_engines[self.__disabled_engines_id].layout
++ if engine.layout != None and engine.layout.startswith("default"):
++ return self.__merge_models_and_options(retval, engine.layout)
+ return retval
+ elif engine.layout != None and engine.layout.startswith("default"):
+ return engine.layout
else:
- return "default"
+diff --git a/ui/gtk/xkbengine.py b/ui/gtk/xkbengine.py
+new file mode 100644
+index 0000000..12c07cf
+--- /dev/null
++++ b/ui/gtk/xkbengine.py
+@@ -0,0 +1,93 @@
++# vim:set et sts=4 sw=4:
++#
++# ibus - The Input Bus
++#
++# Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
++# Copyright(c) 2011 Takao Fujiwara <takao.fujiwara1@gmail.com>
++# Copyright(c) 2011 Red Hat, Inc.
++#
++# This library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2 of the License, or(at your option) any later version.
++#
++# This library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with this program; if not, write to the
++# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
++# Boston, MA 02111-1307 USA
++
++import ibus
++
++class Engine(ibus.EngineBase):
++ def __init__(self, bus, object_path):
++ super(Engine, self).__init__(bus, object_path)
++
++ def update_aux_string(self, string, attrs, visible):
++ self.update_auxiliary_text(ibus.Text(string, attrs), visible)
++
++ def page_up(self):
++ return True
++
++ def page_down(self):
++ return True
++
++ def cursor_up(self):
++ return True
++
++ def cursor_down(self):
++ return True
++
++ def candidate_clicked(self, index, button, state):
++ pass
++
++ if ibus.get_version() >= '1.2.0':
++ def process_key_event(self, keyval, keycode, state):
++ try:
++ return self.process_key_event_internal2(keyval, keycode, state)
++ except:
++ import traceback
++ traceback.print_exc()
++ return False
++ else:
++ def process_key_event(self, keyval, state):
++ try:
++ return self.process_key_event_internal2(keyval, 0, state)
++ except:
++ import traceback
++ traceback.print_exc()
++ return False
++
++ def property_activate(self, prop_name, state):
++ pass
++
++ def focus_in(self):
++ pass
++
++ def focus_out(self):
++ pass
++
++ def disable(self):
++ pass
++
++ def reset(self):
++ pass
++
++ def do_destroy(self):
++ super(Engine,self).do_destroy()
++
++#=======================================================================
++ @classmethod
++ def CONFIG_RELOADED(cls, bus):
++ print 'RELOADED'
++
++ @classmethod
++ def CONFIG_VALUE_CHANGED(cls, bus, section, name, value):
++ print 'VALUE_CHAMGED =', section, name, value
++
++ def process_key_event_internal2(self, keyval, keycode, state):
++ return False
+diff --git a/ui/gtk/xkbfactory.py b/ui/gtk/xkbfactory.py
+new file mode 100644
+index 0000000..014e20b
+--- /dev/null
++++ b/ui/gtk/xkbfactory.py
+@@ -0,0 +1,117 @@
++# vim:set et sts=4 sw=4:
++#
++# ibus - The Input Bus
++#
++# Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
++# Copyright(c) 2011 Takao Fujiwara <takao.fujiwara1@gmail.com>
++# Copyright(c) 2011 Red Hat, Inc.
++#
++# This library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2 of the License, or(at your option) any later version.
++#
++# This library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with this program; if not, write to the
++# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
++# Boston, MA 02111-1307 USA
++
++import ibus
++import xkbengine
++
++from gettext import dgettext
++_ = lambda a : dgettext("ibus", a)
++N_ = lambda a : a
++
++
++class EngineFactory(ibus.EngineFactoryBase):
++ FACTORY_PATH = "/com/redhat/IBus/engines/XKB/Factory"
++ ENGINE_PATH = "/com/redhat/IBus/engines/XKB/Engine"
++ NAME = "XKBFactory"
++ LANG = "en"
++ ICON = "ibus-engine"
++ AUTHORS = "Takao Fujiwara <takao.fujiwara1@gmail.com>"
++ CREDITS = "GPLv2"
++
++ def __init__(self, bus):
++ self.__bus = bus
++ super(EngineFactory, self).__init__(bus)
++
++ self.__id = 0
++
++ def create_engine(self, engine_name):
++ if engine_name and \
++ engine_name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
++
++ self.__id += 1
++ return xkbengine.Engine(self.__bus, "%s/%d" % (self.ENGINE_PATH, self.__id))
++ return super(EngineFactory, self).create_engine(engine_name)
++
++
++def test():
++ import gtk
++ component = ibus.Component("org.freedesktop.IBus.XKB",
++ _("XKB Component"),
++ "1.0",
++ "GPL",
++ "Takao Fujiwara",
++ "https://github.com/fujiwara")
++ engines = []
++ engine = ibus.EngineDesc("xkb:layout:default:jp,us",
++ "Default Layout",
++ "XKB jp,us keyboard layout",
++ "jpn",
++ "LGPL2.1",
++ "fujiwara",
++ "ibus-engine",
++ "jp,us")
++ engines.append(engine)
++ engine = ibus.EngineDesc("xkb:layout:default:us",
++ "Default Layout",
++ "XKB us keyboard layout",
++ "eng",
++ "LGPL2.1",
++ "fujiwara",
++ "ibus-engine",
++ "us")
++ engines.append(engine)
++ for engine in engines:
++ component.add_engine(engine.name,
++ engine.longname,
++ engine.description,
++ engine.language,
++ engine.license,
++ engine.author,
++ engine.icon,
++ engine.layout,
++ engine.hotkeys)
++
++ class TestWindow(gtk.Window):
++ def __init__(self):
++ super(TestWindow, self).__init__()
++ self.__bus = ibus.Bus()
++ self.__bus.connect("disconnected", gtk.main_quit)
++ path = self.__bus.create_input_context("Test")
++ self.__ic = ibus.InputContext(self.__bus, path)
++ self.__ic.set_capabilities(9)
++ factory = EngineFactory(self.__bus)
++ self.__bus.register_component(component)
++ #self.__bus.request_name("org.freedesktop.IBus.XKB", 0)
++ self.connect("focus-in-event", self.__focus_in)
++
++ def __focus_in(self, widget, event):
++ print "focused in"
++ self.__ic.focus_in()
++ self.__ic.set_engine(engines[0])
++
++ window = TestWindow()
++ window.show_all()
++ gtk.main()
++
++if __name__ == "__main__":
++ test()
diff --git a/xkb/Makefile.am b/xkb/Makefile.am
index ad9cdd9..c4d5afb 100644
--- a/xkb/Makefile.am
@@ -1200,30 +1893,19 @@ index ad9cdd9..c4d5afb 100644
$(NULL)
noinst_PROGRAMS = $(TESTS)
-diff --git a/xkb/ibus-engine-xkb-main.c b/xkb/ibus-engine-xkb-main.c
-index 5d748cc..a80f349 100644
---- a/xkb/ibus-engine-xkb-main.c
-+++ b/xkb/ibus-engine-xkb-main.c
-@@ -288,6 +288,14 @@ print_component ()
- layout_desc = (GHashTable *) ibus_xkb_config_registry_get_layout_desc (config_registry);
- variant_desc = (GHashTable *) ibus_xkb_config_registry_get_variant_desc (config_registry);
- component = ibus_xkb_component_new ();
-+#if USE_BRIDGE_HOTKEY
-+ engine = ibus_xkb_engine_desc_new ("en",
-+ "default",
-+ "Default Layout",
-+ NULL,
-+ NULL);
-+ ibus_component_add_engine (component, engine);
-+#endif
- for (keys = g_hash_table_get_keys (layout_list); keys; keys = keys->next) {
- if (keys->data == NULL) {
- continue;
diff --git a/xkb/xkbxml.c b/xkb/xkbxml.c
-index 2ce7bcf..de6648f 100644
+index ad10c28..968fb86 100644
--- a/xkb/xkbxml.c
+++ b/xkb/xkbxml.c
-@@ -273,6 +273,7 @@ ibus_xkb_engine_desc_new (const gchar *lang,
+@@ -25,6 +25,7 @@
+ #endif
+
+ #include <glib.h>
++#include <string.h>
+
+ #include "xkbxml.h"
+ #include "ibus.h"
+@@ -274,6 +275,7 @@ ibus_xkb_engine_desc_new (const gchar *lang,
gchar *longname = NULL;
gchar *desc = NULL;
gchar *engine_layout = NULL;
@@ -1231,19 +1913,20 @@ index 2ce7bcf..de6648f 100644
g_return_val_if_fail (lang != NULL && layout != NULL, NULL);
-@@ -294,6 +295,11 @@ ibus_xkb_engine_desc_new (const gchar *lang,
+@@ -298,6 +300,12 @@ ibus_xkb_engine_desc_new (const gchar *lang,
desc = g_strdup_printf ("XKB %s keyboard layout", layout);
engine_layout = g_strdup (layout);
}
+#if USE_BRIDGE_HOTKEY
-+ if (g_strcmp0 (name, DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
++ if (g_ascii_strncasecmp (name, DEFAULT_BRIDGE_ENGINE_NAME,
++ strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
+ icon = "input-keyboard-symbolic";
+ }
+#endif
engine = ibus_engine_desc_new (name,
longname,
-@@ -301,7 +307,7 @@ ibus_xkb_engine_desc_new (const gchar *lang,
+@@ -305,7 +313,7 @@ ibus_xkb_engine_desc_new (const gchar *lang,
lang,
"LGPL2.1",
"Takao Fujiwara <takao.fujiwara1@gmail.com>",
diff --git a/ibus-xx-factory-signal.patch b/ibus-xx-factory-signal.patch
new file mode 100644
index 0000000..04492b6
--- /dev/null
+++ b/ibus-xx-factory-signal.patch
@@ -0,0 +1,214 @@
+From ff5db39a4651f4ecd3c2ba19dd315ed7b83662f4 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Fri, 5 Aug 2011 20:21:14 +0900
+Subject: [PATCH] Add create-engine signal in IBusFactory for non-C
+ applications.
+
+---
+ bus/ibusimpl.c | 6 +++-
+ bus/inputcontext.c | 5 ++++
+ src/ibusfactory.c | 54 ++++++++++++++++++++++++++++++++++++++++-------
+ src/ibusfactory.h | 7 +++++-
+ src/ibusmarshalers.list | 1 +
+ src/ibusservice.h | 5 +--
+ 6 files changed, 64 insertions(+), 14 deletions(-)
+
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index 853465c..f13d8e0 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -1604,8 +1604,10 @@ _ibus_register_component (BusIBusImpl *ibus,
+ g_object_ref_sink (buscomp));
+ GList *engines = bus_component_get_engines (buscomp);
+ g_list_foreach (engines, (GFunc) g_object_ref, NULL);
+- ibus->register_engine_list = g_list_concat (ibus->register_engine_list,
+- engines);
++ /* We always override the register_engine_list or need to prepare
++ * unregister_component() method so that both ibus gtk and gnome-shell
++ * can call register_component. */
++ ibus->register_engine_list = engines;
+
+ g_signal_connect (buscomp, "destroy", G_CALLBACK (_component_destroy_cb), ibus);
+
+diff --git a/bus/inputcontext.c b/bus/inputcontext.c
+index 47ac9d5..4e8cdc5 100644
+--- a/bus/inputcontext.c
++++ b/bus/inputcontext.c
+@@ -2285,6 +2285,11 @@ new_engine_cb (GObject *obj,
+ "Opertation was cancelled");
+ }
+ else {
++ if (data->context->engine != NULL) {
++ /* Send a Disabled signal. */
++ bus_input_context_unset_engine (data->context);
++ bus_input_context_disable (data->context);
++ }
+ bus_input_context_set_engine (data->context, engine);
+ g_object_unref (engine);
+ bus_input_context_enable (data->context);
+diff --git a/src/ibusfactory.c b/src/ibusfactory.c
+index 11d9a6d..f72f51e 100644
+--- a/src/ibusfactory.c
++++ b/src/ibusfactory.c
+@@ -21,6 +21,7 @@
+ */
+ #include "ibusfactory.h"
+ #include "ibusengine.h"
++#include "ibusmarshalers.h"
+ #include "ibusshare.h"
+ #include "ibusinternal.h"
+
+@@ -28,6 +29,7 @@
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_FACTORY, IBusFactoryPrivate))
+
+ enum {
++ CREATE_ENGINE,
+ LAST_SIGNAL,
+ };
+
+@@ -42,6 +44,8 @@ struct _IBusFactoryPrivate {
+ GHashTable *engine_table;
+ };
+
++static guint factory_signals[LAST_SIGNAL] = { 0 };
++
+ /* functions prototype */
+ static void ibus_factory_destroy (IBusFactory *factory);
+ static void ibus_factory_set_property (IBusFactory *engine,
+@@ -113,6 +117,17 @@ ibus_factory_class_init (IBusFactoryClass *class)
+ ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml);
+
+ g_type_class_add_private (class, sizeof (IBusFactoryPrivate));
++
++ factory_signals[CREATE_ENGINE] =
++ g_signal_new (I_("create-engine"),
++ G_TYPE_FROM_CLASS (gobject_class),
++ G_SIGNAL_RUN_LAST,
++ G_STRUCT_OFFSET (IBusFactoryClass, create_engine),
++ NULL, NULL,
++ _ibus_marshal_OBJECT__STRING,
++ IBUS_TYPE_ENGINE,
++ 1,
++ G_TYPE_STRING);
+ }
+
+ static void
+@@ -190,8 +205,20 @@ ibus_factory_service_method_call (IBusService *service,
+
+ if (g_strcmp0 (method_name, "CreateEngine") == 0) {
+ gchar *engine_name = NULL;
++ GType engine_type;
++ IBusEngine *engine = NULL;
++
+ g_variant_get (parameters, "(&s)", &engine_name);
+- GType engine_type = (GType )g_hash_table_lookup (factory->priv->engine_table, engine_name);
++ engine_type = (GType) g_hash_table_lookup (factory->priv->engine_table, engine_name);
++
++ if (engine_type == G_TYPE_INVALID) {
++ g_signal_emit (factory, factory_signals[CREATE_ENGINE],
++ 0, engine_name, &engine);
++
++ if (engine != NULL && IBUS_IS_ENGINE (engine)) {
++ engine_type = G_OBJECT_TYPE (engine);
++ }
++ }
+
+ if (engine_type == G_TYPE_INVALID) {
+ gchar *error_message = g_strdup_printf ("Can not fond engine %s", engine_name);
+@@ -201,14 +228,25 @@ ibus_factory_service_method_call (IBusService *service,
+ error_message);
+ g_free (error_message);
+ }
+- else {
+- gchar *object_path = g_strdup_printf ("/org/freedesktop/IBus/Engine/%d",
+- ++factory->priv->id);
+- IBusEngine *engine = ibus_engine_new_type (engine_type,
+- engine_name,
+- object_path,
+- ibus_service_get_connection ((IBusService *)factory));
++ else {
++ gchar *object_path = NULL;
++ if (engine == NULL) {
++ object_path = g_strdup_printf ("/org/freedesktop/IBus/Engine/%d",
++ ++factory->priv->id);
++ engine = ibus_engine_new_type (engine_type,
++ engine_name,
++ object_path,
++ ibus_service_get_connection ((IBusService *)factory));
++ } else {
++ GValue value = { 0, };
++ g_value_init (&value, G_TYPE_STRING);
++ g_object_get_property (G_OBJECT (engine), "object-path", &value);
++ object_path = g_value_dup_string (&value);
++ g_value_unset (&value);
++ }
++
+ g_assert (engine != NULL);
++ g_assert (object_path != NULL);
+ g_object_ref_sink (engine);
+ factory->priv->engine_list = g_list_append (factory->priv->engine_list, engine);
+ g_signal_connect (engine,
+diff --git a/src/ibusfactory.h b/src/ibusfactory.h
+index 47c06e0..03d1dea 100644
+--- a/src/ibusfactory.h
++++ b/src/ibusfactory.h
+@@ -42,6 +42,7 @@
+
+ #include "ibusservice.h"
+ #include "ibusserializable.h"
++#include "ibusengine.h"
+
+ G_BEGIN_DECLS
+
+@@ -127,10 +128,14 @@ struct _IBusFactoryClass {
+ IBusServiceClass parent;
+
+ /* signals */
++ IBusEngine *
++ (* create_engine)
++ (IBusFactory *factory,
++ const gchar *engine_name);
+
+ /*< private >*/
+ /* padding */
+- gpointer pdummy[8];
++ gpointer pdummy[7];
+ };
+
+ /**
+diff --git a/src/ibusmarshalers.list b/src/ibusmarshalers.list
+index c073c6e..82b4aea 100644
+--- a/src/ibusmarshalers.list
++++ b/src/ibusmarshalers.list
+@@ -23,3 +23,4 @@ VOID:STRING,STRING,VARIANT
+ VOID:STRING,STRING,STRING
+ VOID:UINT
+ VOID:UINT,POINTER
++OBJECT:STRING
+diff --git a/src/ibusservice.h b/src/ibusservice.h
+index 7a3fea7..94f9bb7 100644
+--- a/src/ibusservice.h
++++ b/src/ibusservice.h
+@@ -135,9 +135,9 @@ IBusService *ibus_service_new (GDBusConnection *connection,
+ const gchar *ibus_service_get_object_path (IBusService *service);
+
+ /**
+- * ibus_service_get_connections:
++ * ibus_service_get_connection:
+ * @service: An IBusService.
+- * @returns: (transfer all) (element-type GDBusConnection): A newly allocated list of connections.
++ * @returns: (transfer none): A #GDBusConnection of an #IBusService instance.
+ *
+ * Returns a connections.
+ */
+@@ -190,7 +190,6 @@ gboolean ibus_service_emit_signal (IBusService *service,
+ * ibus_service_class_add_interfaces:
+ * @klass: An IBusServiceClass.
+ * @xml_data: The introspection xml data.
+- * @error: Error.
+ *
+ * Set the interface introspection information with the service class.
+ */
+--
+1.7.5.4
+
diff --git a/ibus-xx-setup-frequent-lang.patch b/ibus-xx-setup-frequent-lang.patch
index 936dd5a..67d7e0b 100644
--- a/ibus-xx-setup-frequent-lang.patch
+++ b/ibus-xx-setup-frequent-lang.patch
@@ -1,20 +1,20 @@
-From 735a4d98ac057ded317dae9b85777ce56d8af0fd Mon Sep 17 00:00:00 2001
+From 6937ff7453a352dc63a6487c7726acdb8942f8c9 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 20 Jun 2011 19:04:51 +0900
+Date: Fri, 5 Aug 2011 20:23:07 +0900
Subject: [PATCH] Enable ibus-setup to show the frequently used languages
only in IME list.
---
- data/ibus.schemas.in | 168 +++++++++++++++++++++++++++++++++++++++++++++++
+ data/ibus.schemas.in.in | 168 +++++++++++++++++++++++++++++++++++++++++++++++
setup/enginecombobox.py | 153 ++++++++++++++++++++++++++++++++++++------
setup/main.py | 1 +
3 files changed, 300 insertions(+), 22 deletions(-)
diff --git a/data/ibus.schemas.in.in b/data/ibus.schemas.in.in
-index d4334e1..5ef2ac2 100644
+index 2df4f19..692664b 100644
--- a/data/ibus.schemas.in.in
+++ b/data/ibus.schemas.in.in
-@@ -239,6 +239,174 @@
+@@ -240,6 +240,174 @@
</locale>
</schema>
<schema>
@@ -210,18 +210,6 @@ index 7383177..bff2407 100644
- def set_engines(self, engines):
- self.__model = gtk.TreeStore(gobject.TYPE_PYOBJECT)
--
-- iter1 = self.__model.append(None)
-- self.__model.set(iter1, 0, 0)
-- lang = {}
-- for e in engines:
-- if ibus.use_bridge_hotkey() and \
-- e.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
-- continue
-- l = ibus.get_language_name(e.language)
-- if l not in lang:
-- lang[l] = []
-- lang[l].append(e)
+ def __gconf_get_lang_list_from_locale(self):
+ common_list = ['en', 'Other']
+ if self.__config == None:
@@ -256,7 +244,18 @@ index 7383177..bff2407 100644
+ if lang_list == None:
+ return [loc] + common_list
+ return lang_list + common_list
-+
+
+- iter1 = self.__model.append(None)
+- self.__model.set(iter1, 0, 0)
+- lang = {}
+- for e in engines:
+- if ibus.use_bridge_hotkey() and \
+- e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+- continue
+- l = ibus.get_language_name(e.language)
+- if l not in lang:
+- lang[l] = []
+- lang[l].append(e)
+ def __has_engine_in_lang_list(self, engine, lang_list):
+ retval = False
+ for lang in lang_list:
@@ -270,7 +269,7 @@ index 7383177..bff2407 100644
keys = lang.keys()
keys.sort(locale.strcoll)
#add "Others" to the end of the combo box
-@@ -79,29 +112,89 @@ class EngineComboBox(gtk.ComboBox):
+@@ -76,29 +112,89 @@ class EngineComboBox(gtk.ComboBox):
keys.remove(ibus.get_language_name("Other"))
keys += [ibus.get_language_name("Other")]
for l in keys:
@@ -291,8 +290,7 @@ index 7383177..bff2407 100644
+
+ def set_engines(self, engines):
+ self.__model = gtk.TreeStore(gobject.TYPE_PYOBJECT)
-
-- self.set_model(self.__model)
++
+ iter1 = self.__model.append(None)
+ self.__model.set(iter1, 0, 0)
+ lang_list = self.__gconf_get_lang_list_from_locale()
@@ -300,7 +298,7 @@ index 7383177..bff2407 100644
+ sub_lang = {}
+ for e in engines:
+ if ibus.use_bridge_hotkey() and \
-+ e.name == ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
+ continue
+ l = ibus.get_language_name(e.language)
+ if lang_list == None or \
@@ -326,7 +324,8 @@ index 7383177..bff2407 100644
+ self.__model_append_langs(self.__all_model, sub_lang, False)
+
+ self.__toggle_sub_lang()
-+
+
+- self.set_model(self.__model)
+ def __toggle_sub_lang(self):
+ self.set_model(None)
+ if self.__show_sub_lang:
@@ -368,7 +367,7 @@ index 7383177..bff2407 100644
else:
renderer.set_property("visible", True)
renderer.set_property("sensitive", True)
-@@ -113,7 +206,8 @@ class EngineComboBox(gtk.ComboBox):
+@@ -110,7 +203,8 @@ class EngineComboBox(gtk.ComboBox):
renderer.set_property("pixbuf", pixbuf)
def __name_cell_data_cb(self, celllayout, renderer, model, iter):
@@ -378,7 +377,7 @@ index 7383177..bff2407 100644
if isinstance (engine, str) or isinstance (engine, unicode):
renderer.set_property("sensitive", False)
-@@ -121,8 +215,15 @@ class EngineComboBox(gtk.ComboBox):
+@@ -118,8 +212,15 @@ class EngineComboBox(gtk.ComboBox):
renderer.set_property("weight", pango.WEIGHT_NORMAL)
elif isinstance(engine, int):
renderer.set_property("sensitive", True)
@@ -396,7 +395,7 @@ index 7383177..bff2407 100644
else:
renderer.set_property("sensitive", True)
renderer.set_property("text", engine.longname)
-@@ -137,13 +238,21 @@ class EngineComboBox(gtk.ComboBox):
+@@ -134,13 +235,21 @@ class EngineComboBox(gtk.ComboBox):
if i == 0 or i == -1:
return None
iter = self.get_active_iter()
@@ -432,5 +431,5 @@ index 192fb88..5a0170d 100644
engines = self.__bus.list_active_engines()
--
-1.7.4.4
+1.7.5.4
diff --git a/ibus.spec b/ibus.spec
index af1529d..c976b89 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -20,7 +20,7 @@
Name: ibus
Version: 1.3.99.20110419
-Release: 12%{?dist}
+Release: 13%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@@ -28,15 +28,16 @@ URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: xinput-ibus
%if %have_gjsfile
-Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/ibus-gjs-1.3.99.20110720.tar.gz
+Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/ibus-gjs-1.3.99.20110806.tar.gz
%endif
Source3: https://www.transifex.net/projects/p/ibus/resource/master/l/da/download/ibus_master_da.po
Patch0: ibus-HEAD.patch
Patch1: ibus-530711-preload-sys.patch
Patch2: ibus-xx-icon-symbol.patch
-Patch3: ibus-541492-xkb.patch
-Patch4: ibus-xx-bridge-hotkey.patch
-Patch5: ibus-xx-setup-frequent-lang.patch
+Patch3: ibus-xx-factory-signal.patch
+Patch4: ibus-541492-xkb.patch
+Patch5: ibus-xx-bridge-hotkey.patch
+Patch6: ibus-xx-setup-frequent-lang.patch
# Workaround for oxygen-gtk icon theme until bug 699103 is fixed.
Patch91: ibus-711632-fedora-fallback-icon.patch
@@ -172,12 +173,13 @@ cp %SOURCE3 po/da.po
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
%patch1 -p1 -b .preload-sys
%patch2 -p1 -b .icon-symbol
+%patch3 -p1 -b .factory
%if %have_libxkbfile
-%patch3 -p1 -b .xkb
+%patch4 -p1 -b .xkb
%endif
mv data/ibus.schemas.in data/ibus.schemas.in.in
-%patch4 -p1 -b .bridge-key
-%patch5 -p1 -b .setup-frequent-lang
+%patch5 -p1 -b .bridge-key
+%patch6 -p1 -b .setup-frequent-lang
%patch91 -p1 -b .fallback-icon
@@ -362,14 +364,17 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
-* Wed Jul 20 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-12
+* Fri Aug 05 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-13
- Updated ibus-HEAD.patch for upstream.
- Removed ibus-435880-surrounding-text.patch as upstream.
- Added ibus-711632-fedora-fallback-icon.patch
Fixed SEGV with no icon in oxygen-gtk icon theme.
- Added ibus-xx-icon-symbol.patch
+ Fixed Bug 700472 Use a symbol icon instead of an image icon.
- Added ibus-xx-bridge-hotkey.patch
+ Triaged Bug 707370 SetEngine timeout
- Added transitional ibus-gnome3 package.
+ Fixed Bug 718110 Use a shell icon instead of pygtk2 icon.
* Thu May 26 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-1
- Updated to 1.3.99.20110419
diff --git a/sources b/sources
index 2e0d197..90152fa 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
d4f2729fecb92ae6b41f26c770b1a772 ibus-1.3.99.20110419.tar.gz
-41915a2dc5ed10c23a47e901611ac54a ibus-gjs-1.3.99.20110720.tar.gz
+b2214490304ab89d599cf72d012fde3c ibus-gjs-1.3.99.20110806.tar.gz
698c90edf0f037488e1aa969804e891f ibus_master_da.po
^ permalink raw reply related [flat|nested] 3+ messages in thread* [rpms/ibus] autotool: Updated ibus-xx-bridge-hotkey.patch
@ 2026-05-31 2:05 Takao Fujiwara
0 siblings, 0 replies; 3+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : b4e3b48e01fb921ce29fd1d164057acac4545065
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2011-07-05T12:40:53+09:00
Stats : +241/-68 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/b4e3b48e01fb921ce29fd1d164057acac4545065?branch=autotool
Log:
Updated ibus-xx-bridge-hotkey.patch
Fixed 718892, 718453, 718450
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 4be8960..a492a1a 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -967,3 +967,28 @@ index 29b8f1d..6da342a 100644
--
1.7.4.4
+From a25187a315e9dfbb36a3e4a4f8e96f18e2cc6e0d Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Tue, 5 Jul 2011 12:15:55 +0900
+Subject: [PATCH] Fix SEGV in ibus_keymap_lookup_keysym
+
+---
+ bus/engineproxy.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bus/engineproxy.c b/bus/engineproxy.c
+index 95e9e0b..a49d6fd 100644
+--- a/bus/engineproxy.c
++++ b/bus/engineproxy.c
+@@ -907,7 +907,7 @@ bus_engine_proxy_process_key_event (BusEngineProxy *engine,
+ if (keymap == NULL)
+ keymap = BUS_DEFAULT_KEYMAP;
+ if (keymap != NULL) {
+- guint t = ibus_keymap_lookup_keysym (engine->keymap, keycode, state);
++ guint t = ibus_keymap_lookup_keysym (keymap, keycode, state);
+ if (t != IBUS_VoidSymbol) {
+ keyval = t;
+ }
+--
+1.7.5.4
+
diff --git a/ibus-xx-bridge-hotkey.patch b/ibus-xx-bridge-hotkey.patch
index fbe821a..1111735 100644
--- a/ibus-xx-bridge-hotkey.patch
+++ b/ibus-xx-bridge-hotkey.patch
@@ -1,32 +1,31 @@
-From bbf124332b8ba43f369be86ba3a6411fe66556d1 Mon Sep 17 00:00:00 2001
+From 0242d89ec9d4d3d92d335e50b8aa6c16ff950438 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 30 Jun 2011 11:46:02 +0900
+Date: Tue, 5 Jul 2011 12:00:31 +0900
Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
of on-off.
---
- bus/Makefile.am | 20 ++--
- bus/ibusimpl.c | 255 ++++++++++++++++++++++++++++++----------
- bus/registry.c | 35 ++++++
- configure.ac | 31 +++++
+ bus/Makefile.am | 20 ++-
+ bus/ibusimpl.c | 356 ++++++++++++++++++++++++++++++++++++--------
+ bus/registry.c | 35 +++++
+ configure.ac | 31 ++++
data/Makefile.am | 6 +-
- data/ibus.schemas.in | 286 --------------------------------------------
- data/ibus.schemas.in.in | 286 ++++++++++++++++++++++++++++++++++++++++++++
+ data/ibus.schemas.in | 286 -----------------------------------
+ data/ibus.schemas.in.in | 286 +++++++++++++++++++++++++++++++++++
ibus/_config.py.in | 6 +
ibus/inputcontext.py | 4 +
setup/enginecombobox.py | 3 +
setup/enginetreeview.py | 16 ++-
- src/Makefile.am | 18 ++--
+ src/Makefile.am | 18 ++-
src/ibusbus.c | 12 ++
src/ibusbus.h | 18 +++
- src/ibusenginedesc.c | 4 +
src/ibushotkey.c | 11 ++
src/ibushotkey.h | 11 ++
- ui/gtk/panel.py | 157 +++++++++++++++++++++---
+ ui/gtk/panel.py | 189 +++++++++++++++++++++---
xkb/Makefile.am | 2 +
- xkb/ibus-engine-xkb-main.c | 8 ++
+ xkb/ibus-engine-xkb-main.c | 8 +
xkb/xkbxml.c | 8 +-
- 21 files changed, 810 insertions(+), 387 deletions(-)
+ 20 files changed, 938 insertions(+), 388 deletions(-)
delete mode 100644 data/ibus.schemas.in
create mode 100644 data/ibus.schemas.in.in
@@ -62,7 +61,7 @@ index 074b456..0efaa1b 100644
AM_LDADD = \
@GOBJECT2_LIBS@ \
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index b356b2c..f3ca330 100644
+index b356b2c..ffea37a 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -20,6 +20,10 @@
@@ -87,7 +86,16 @@ index b356b2c..f3ca330 100644
};
struct _BusIBusImplClass {
-@@ -285,6 +293,30 @@ _panel_destroy_cb (BusPanelProxy *panel,
+@@ -99,6 +107,8 @@ enum {
+ static guint _signals[LAST_SIGNAL] = { 0 };
+ */
+
++static gchar *_bridge_trigger_keys = NULL;
++
+ /* functions prototype */
+ static void bus_ibus_impl_destroy (BusIBusImpl *ibus);
+ static void bus_ibus_impl_service_method_call
+@@ -285,6 +295,30 @@ _panel_destroy_cb (BusPanelProxy *panel,
g_object_unref (panel);
}
@@ -118,7 +126,7 @@ index b356b2c..f3ca330 100644
static void
_config_set_value_done (GObject *object,
GAsyncResult *res,
-@@ -475,8 +507,21 @@ _set_preload_engines (BusIBusImpl *ibus,
+@@ -475,8 +509,21 @@ _set_preload_engines (BusIBusImpl *ibus,
g_variant_unref (value);
}
@@ -133,7 +141,7 @@ index b356b2c..f3ca330 100644
+ engine_list = g_list_insert (engine_list, engine, 1);
+ } else {
+ engine_list = g_list_append (engine_list, engine);
-+ }
++ }
+ ibus->engine_list = engine_list;
+ }
+#endif
@@ -141,17 +149,63 @@ index b356b2c..f3ca330 100644
if (ibus->engine_list) {
BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) ibus->engine_list->data);
-@@ -573,7 +618,9 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
+@@ -562,6 +609,43 @@ bus_ibus_impl_set_hotkey (BusIBusImpl *i
+
+ }
+
++#if USE_BRIDGE_HOTKEY
++static void
++bus_ibus_impl_set_bridge_trigger_keys (BusIBusImpl *ibus,
++ GQuark hotkey,
++ GVariant *value)
++{
++ g_assert (BUS_IS_IBUS_IMPL (ibus));
++
++ ibus_hotkey_profile_remove_hotkey_by_event (ibus->hotkey_profile, hotkey);
++
++ if (value == NULL) {
++ return;
++ }
++
++ GVariantIter iter;
++ g_variant_iter_init (&iter, value);
++ const gchar *str = NULL;
++
++ g_free (_bridge_trigger_keys);
++ _bridge_trigger_keys = NULL;
++
++ while (g_variant_iter_loop (&iter,"&s", &str)) {
++ if (str != NULL) {
++ gchar *tmp =NULL;
++
++ if (_bridge_trigger_keys) {
++ tmp = g_strdup_printf ("%s,%s", _bridge_trigger_keys, str);
++ } else {
++ tmp = g_strdup (str);
++ }
++ g_free (_bridge_trigger_keys);
++ _bridge_trigger_keys = tmp;
++ }
++ }
++}
++#endif
++
+ /**
+ * bus_ibus_impl_set_trigger:
+ *
+@@ -573,7 +657,11 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
{
GQuark hotkey = g_quark_from_static_string ("trigger");
if (value != NULL) {
-+#if !USE_BRIDGE_HOTKEY
++#if USE_BRIDGE_HOTKEY
++ bus_ibus_impl_set_bridge_trigger_keys (ibus, hotkey, value);
++#else
bus_ibus_impl_set_hotkey (ibus, hotkey, value);
+#endif
}
#ifndef OS_CHROMEOS
else {
-@@ -1182,28 +1229,110 @@ _ibus_get_address (BusIBusImpl
+@@ -1182,28 +1270,110 @@ _ibus_get_address (BusIBusImpl
g_variant_new ("(s)", bus_server_get_address ()));
}
@@ -279,7 +333,7 @@ index b356b2c..f3ca330 100644
}
/**
-@@ -1216,7 +1345,39 @@ _context_request_engine_cb (BusInputCont
+@@ -1216,7 +1386,61 @@ _context_request_engine_cb (BusInputCont
const gchar *engine_name,
BusIBusImpl *ibus)
{
@@ -292,24 +346,46 @@ index b356b2c..f3ca330 100644
+
+#if USE_BRIDGE_HOTKEY
+ IBusEngineDesc *current_desc = NULL;
++
+ if (context) {
+ BusEngineProxy *engine = bus_input_context_get_engine (context);
+ if (engine != NULL) {
+ current_desc = bus_engine_proxy_get_desc (engine);
+ }
+ }
++
+ if (current_desc) {
+ ibus->prev_hotkey_engine = current_desc;
+ }
++
+ if (current_desc != NULL && desc != NULL &&
+ g_strcmp0 (ibus_engine_desc_get_name (current_desc),
+ ibus_engine_desc_get_name (desc)) != 0 &&
+ g_strcmp0 (ibus_engine_desc_get_name (desc),
+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
-+ const gchar *hotkeys = ibus_engine_desc_get_hotkeys (current_desc);
++ const gchar *hotkeys = NULL;
++
++ /* If the user customized the trigger key, the trigger key is used for
++ * any IBus engines. */
++ if (_bridge_trigger_keys != NULL &&
++ *_bridge_trigger_keys != '\0' &&
++ g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
++
++ hotkeys = (const gchar *) _bridge_trigger_keys;
++ } else {
++ hotkeys = ibus_engine_desc_get_hotkeys (current_desc);
++ }
++
++ /* If engine hotkeys are not defined in the compose xml file, IBus trigger
++ * keys are used. */
+ if (!hotkeys || !*hotkeys) {
-+ hotkeys = "Control+space";
++ hotkeys = (const gchar *) _bridge_trigger_keys;
++ }
++
++ if (!hotkeys || !*hotkeys) {
++ return desc;
+ }
++
+ ibus_hotkey_profile_foreach_hotkey (ibus->engines_hotkey_profile,
+ _foreach_remove_engine_hotkey,
+ &id);
@@ -320,19 +396,23 @@ index b356b2c..f3ca330 100644
}
/**
-@@ -2357,6 +2518,11 @@ bus_ibus_impl_filter_keyboard_shortcuts
- * the same hotkey, then we should switch to the next engine with the
- * same hotkey in the list. Otherwise, we just switch to the first
- * engine in the list. */
+@@ -2353,6 +2577,15 @@ bus_ibus_impl_filter_keyboard_shortcuts
+
+ g_assert (new_engine_desc);
+
+#if USE_BRIDGE_HOTKEY
-+ if (ibus->prev_hotkey_engine) {
++ /* If the previous engine is not included in engine_list,
++ * this enables a new engine instead of toggling the engines
++ * so should not enable the previous engine. */
++ if (ibus->prev_hotkey_engine &&
++ g_list_find (engine_list, ibus->prev_hotkey_engine) != NULL) {
+ new_engine_desc = ibus->prev_hotkey_engine;
+ }
+#else
- GList *p = engine_list;
- for (; p->next != NULL; p = p->next) {
- if (current_engine_desc == (IBusEngineDesc *) p->data) {
-@@ -2364,8 +2530,16 @@ bus_ibus_impl_filter_keyboard_shortcuts
+ /* Find out what engine we should switch to. If the current engine has
+ * the same hotkey, then we should switch to the next engine with the
+ * same hotkey in the list. Otherwise, we just switch to the first
+@@ -2364,8 +2597,31 @@ bus_ibus_impl_filter_keyboard_shortcuts
break;
}
}
@@ -343,13 +423,28 @@ index b356b2c..f3ca330 100644
+ g_strcmp0 (ibus_engine_desc_get_name (new_engine_desc),
+ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
+ ibus->prev_hotkey_engine = current_engine_desc;
++
++ /* If the previous engine is not included in engine_list and
++ * the current engine is the defualt bridge engine,
++ * the current engine is also not included in engine_list.
++ * So the engine is added here. */
++ if (g_list_find (engine_list, current_engine_desc) == NULL &&
++ g_strcmp0 (ibus_engine_desc_get_name (current_engine_desc),
++ DEFAULT_BRIDGE_ENGINE_NAME) == 0) {
++ engine_list = g_list_append (engine_list, current_engine_desc);
++
++ g_hash_table_steal (ibus->hotkey_to_engines_map,
++ GUINT_TO_POINTER (event));
++ g_hash_table_insert (ibus->hotkey_to_engines_map,
++ GUINT_TO_POINTER (event), engine_list);
++ }
+#else
if (current_engine_desc != new_engine_desc) {
+#endif
bus_ibus_impl_set_context_engine_from_desc (ibus, context, new_engine_desc);
}
-@@ -2470,14 +2644,6 @@ static void
+@@ -2470,59 +2726,39 @@ static void
_add_engine_hotkey (IBusEngineDesc *engine, BusIBusImpl *ibus)
{
const gchar *hotkeys;
@@ -364,10 +459,32 @@ index b356b2c..f3ca330 100644
if (!engine) {
return;
-@@ -2489,40 +2655,7 @@ _add_engine_hotkey (IBusEngineDesc *engi
- return;
}
++#if USE_BRIDGE_HOTKEY
++ /* If the user customized the trigger key, the trigger key is used for
++ * any IBus engines. */
++ if (_bridge_trigger_keys != NULL &&
++ *_bridge_trigger_keys != '\0' &&
++ g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
++
++ hotkeys = (const gchar *) _bridge_trigger_keys;
++ } else {
++ hotkeys = ibus_engine_desc_get_hotkeys (engine);
++ }
++#else
+ hotkeys = ibus_engine_desc_get_hotkeys (engine);
++#endif
+
++#if USE_BRIDGE_HOTKEY
++ /* If engine hotkeys are not defined in the compose xml file, IBus trigger
++ * keys are used. */
+ if (!hotkeys || !*hotkeys) {
+- return;
++ hotkeys = (const gchar *) _bridge_trigger_keys;
+ }
++#endif
+
- hotkey_list = g_strsplit_set (hotkeys, ";,", 0);
-
- for (p = hotkey_list; p && *p; ++p) {
@@ -399,8 +516,10 @@ index b356b2c..f3ca330 100644
-
- g_hash_table_insert (ibus->hotkey_to_engines_map,
- GUINT_TO_POINTER (event), engine_list);
-- }
--
++ if (!hotkeys || !*hotkeys) {
++ return;
+ }
+
- g_strfreev (hotkey_list);
+ _add_engine_hotkey_with_hotkeys (engine, ibus, hotkeys);
}
@@ -473,7 +592,7 @@ index bc6680d..f47f727 100644
static void
diff --git a/configure.ac b/configure.ac
-index 85e5e30..a6974d4 100644
+index 85e5e30..3ada2f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -438,6 +438,34 @@ else
@@ -490,7 +609,7 @@ index 85e5e30..a6974d4 100644
+
+if test x"$enable_bridge_hotkey" = x"yes"; then
+ USE_BRIDGE_HOTKEY=1
-+ TRIGGER_HOTKEYS=""
++ TRIGGER_HOTKEYS="Control+space"
+else
+ USE_BRIDGE_HOTKEY=0
+ TRIGGER_HOTKEYS="Control+space,Zenkaku_Hankaku,Alt+Kanji,Alt+grave,Hangul,Alt+Release+Alt_R"
@@ -737,22 +856,6 @@ index 77d3916..f560671 100644
+
G_END_DECLS
#endif
-diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c
-index fa3a768..3d6100e 100644
---- a/src/ibusenginedesc.c
-+++ b/src/ibusenginedesc.c
-@@ -232,7 +232,11 @@ ibus_engine_desc_class_init (IBusEngineDescClass *class)
- g_param_spec_string ("hotkeys",
- "description hotkeys",
- "The hotkeys of engine description",
-+#if USE_BRIDGE_HOTKEY
-+ "Control+space",
-+#else
- "",
-+#endif
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- /**
diff --git a/src/ibushotkey.c b/src/ibushotkey.c
index 32f8338..bef7dfc 100644
--- a/src/ibushotkey.c
@@ -794,10 +897,10 @@ index 9a341f6..92ec6af 100644
G_END_DECLS
#endif
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
-index de64920..5839238 100644
+index de64920..55acd5a 100644
--- a/ui/gtk/panel.py
+++ b/ui/gtk/panel.py
-@@ -133,6 +133,14 @@ class Panel(ibus.PanelBase):
+@@ -133,6 +133,15 @@ class Panel(ibus.PanelBase):
# self.__bus.request_name(ibus.panel.IBUS_SERVICE_PANEL, 0)
# init xkb
@@ -808,11 +911,12 @@ index de64920..5839238 100644
+ self.__disabled_engines_id = -1
+ self.__disabled_engines_prev_id = -1
+ self.__disabled_engines_swapped = 0
++ self.__show = 0
+
self.__xkblayout = ibus.XKBLayout(self.__config)
use_xkb = self.__config.get_value("general", "use_system_keyboard_layout", False)
if not use_xkb:
-@@ -142,11 +150,18 @@ class Panel(ibus.PanelBase):
+@@ -142,11 +151,18 @@ class Panel(ibus.PanelBase):
value = 'default'
if value != 'default':
self.__xkblayout.set_default_layout(value)
@@ -831,7 +935,7 @@ index de64920..5839238 100644
def set_cursor_location(self, x, y, w, h):
self.__candidate_panel.set_cursor_location(x, y, w, h)
-@@ -233,12 +248,57 @@ class Panel(ibus.PanelBase):
+@@ -233,12 +249,69 @@ class Panel(ibus.PanelBase):
def __set_im_name(self, name):
self.__language_bar.set_im_name(name)
@@ -882,14 +986,27 @@ index de64920..5839238 100644
self.reset()
self.__focus_ic = ibus.InputContext(self.__bus, ic)
enabled = self.__focus_ic.is_enabled()
- self.__language_bar.set_enabled(enabled)
+- self.__language_bar.set_enabled(enabled)
+ if ibus.use_bridge_hotkey():
+ self.__set_default_layout_engine()
++ if self.__show != 1:
++ self.__language_bar.set_enabled(enabled)
++ elif enabled:
++ engine = self.__focus_ic.get_engine()
++ if engine != None and \
++ engine.name != ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ self.__language_bar.set_enabled(enabled)
++ else:
++ self.__language_bar.set_enabled(False)
++ else:
++ self.__language_bar.set_enabled(False)
++ else:
++ self.__language_bar.set_enabled(enabled)
if not enabled:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -250,7 +310,7 @@ class Panel(ibus.PanelBase):
+@@ -250,7 +323,7 @@ class Panel(ibus.PanelBase):
self.__set_im_icon(engine.icon)
self.__set_im_name(engine.longname)
if self.__bus.get_use_sys_layout():
@@ -898,7 +1015,30 @@ index de64920..5839238 100644
else:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -287,7 +347,7 @@ class Panel(ibus.PanelBase):
+@@ -273,7 +346,21 @@ class Panel(ibus.PanelBase):
+ return
+
+ enabled = self.__focus_ic.is_enabled()
+- self.__language_bar.set_enabled(enabled)
++
++ if ibus.use_bridge_hotkey():
++ if self.__show != 1:
++ self.__language_bar.set_enabled(enabled)
++ elif enabled:
++ engine = self.__focus_ic.get_engine()
++ if engine != None and \
++ engine.name != ibus.DEFAULT_BRIDGE_ENGINE_NAME:
++ self.__language_bar.set_enabled(enabled)
++ else:
++ self.__language_bar.set_enabled(False)
++ else:
++ self.__language_bar.set_enabled(False)
++ else:
++ self.__language_bar.set_enabled(enabled)
+
+ if enabled == False:
+ self.reset()
+@@ -287,7 +374,7 @@ class Panel(ibus.PanelBase):
self.__set_im_icon(engine.icon)
self.__set_im_name(engine.longname)
if self.__bus.get_use_sys_layout():
@@ -907,7 +1047,15 @@ index de64920..5839238 100644
else:
self.__set_im_icon(ICON_KEYBOARD)
self.__set_im_name(None)
-@@ -443,6 +503,21 @@ class Panel(ibus.PanelBase):
+@@ -315,6 +402,7 @@ class Panel(ibus.PanelBase):
+
+ def __config_load_show(self):
+ show = self.__config.get_value("panel", "show", 0)
++ self.__show = show
+ self.__language_bar.set_show(show)
+
+ def __config_load_position(self):
+@@ -443,6 +531,21 @@ class Panel(ibus.PanelBase):
# menu.set_take_focus(False)
# return menu
@@ -929,7 +1077,7 @@ index de64920..5839238 100644
def __create_im_menu(self):
engines = self.__bus.list_active_engines()
current_engine = \
-@@ -453,25 +528,31 @@ class Panel(ibus.PanelBase):
+@@ -453,25 +556,31 @@ class Panel(ibus.PanelBase):
size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
menu = gtk.Menu()
for i, engine in enumerate(engines):
@@ -974,7 +1122,7 @@ index de64920..5839238 100644
menu.show_all()
menu.set_take_focus(False)
-@@ -523,8 +604,25 @@ class Panel(ibus.PanelBase):
+@@ -523,8 +632,25 @@ class Panel(ibus.PanelBase):
if not self.__focus_ic:
return
if engine:
@@ -1001,7 +1149,7 @@ index de64920..5839238 100644
self.__focus_ic.disable()
def __sys_menu_item_activate_cb(self, item, command):
-@@ -573,11 +671,34 @@ class Panel(ibus.PanelBase):
+@@ -573,11 +699,34 @@ class Panel(ibus.PanelBase):
self.__setup_pid = pid
glib.child_watch_add(self.__setup_pid, self.__child_watch_cb)
diff --git a/ibus.spec b/ibus.spec
index d5d72a8..7a9162c 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -13,7 +13,7 @@
Name: ibus
Version: 1.3.99.20110419
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@@ -354,7 +354,7 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
-* Mon Jun 20 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-7
+* Mon Jun 20 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-8
- Updated ibus-HEAD.patch for upstream.
- Removed ibus-435880-surrounding-text.patch as upstream.
- Added ibus-711632-fedora-fallback-icon.patch
^ permalink raw reply related [flat|nested] 3+ messages in thread* [rpms/ibus] autotool: Updated ibus-xx-bridge-hotkey.patch
@ 2026-05-31 2:05 Takao Fujiwara
0 siblings, 0 replies; 3+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 577a9816b5bcdb550c71b6867e784577a472a3ea
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2011-06-22T20:07:06+09:00
Stats : +48/-21 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/577a9816b5bcdb550c71b6867e784577a472a3ea?branch=autotool
Log:
Updated ibus-xx-bridge-hotkey.patch
- Fixed the position in menu item.
- Fixed not to delete hotkeys with ibus-setup.
---
diff --git a/.gitignore b/.gitignore
index f33ca6e..18873c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,9 +10,7 @@ ibus-1.3.6.tar.gz
/ibus-1.3.99.20110206.tar.gz
/ibus-1.3.99.20110228.tar.gz
/ibus-1.3.99.20110408.tar.gz
-/gnome-shell-ibus-plugins-20110317.tar.bz2
-/ibus_master_da.po
/ibus-1.3.99.20110419.tar.gz
-/gnome-shell-ibus-plugins-20110601.tar.bz2
-/gnome-shell-ibus-plugins-20110621.tar.bz2
+/gnome-shell-ibus-plugins-20110622.tar.bz2
+/ibus_master_da.po
/ibus-indicator.tar.bz2
diff --git a/ibus-xx-bridge-hotkey.patch b/ibus-xx-bridge-hotkey.patch
index 824dd81..f2a78a2 100644
--- a/ibus-xx-bridge-hotkey.patch
+++ b/ibus-xx-bridge-hotkey.patch
@@ -1,12 +1,12 @@
-From a3a7b364410511b3a17f2b1566ba4c4c4f0de2cf Mon Sep 17 00:00:00 2001
+From faaea227c58ec17d392ec4ecdf3851e1a52ecd00 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 21 Jun 2011 17:00:54 +0900
+Date: Wed, 22 Jun 2011 19:26:21 +0900
Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
of on-off.
---
bus/Makefile.am | 20 ++--
- bus/ibusimpl.c | 244 ++++++++++++++++++++++++++++----------
+ bus/ibusimpl.c | 250 +++++++++++++++++++++++++++++----------
bus/registry.c | 35 ++++++
configure.ac | 31 +++++
data/Makefile.am | 6 +-
@@ -14,6 +14,7 @@ Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
data/ibus.schemas.in.in | 286 ++++++++++++++++++++++++++++++++++++++++++++
ibus/_config.py.in | 6 +
ibus/inputcontext.py | 4 +
+ setup/enginetreeview.py | 3 +
src/Makefile.am | 1 +
src/ibusbus.c | 6 +
src/ibusbus.h | 9 ++
@@ -24,7 +25,7 @@ Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
xkb/Makefile.am | 2 +
xkb/ibus-engine-xkb-main.c | 8 ++
xkb/xkbxml.c | 8 +-
- 19 files changed, 677 insertions(+), 361 deletions(-)
+ 20 files changed, 686 insertions(+), 361 deletions(-)
delete mode 100644 data/ibus.schemas.in
create mode 100644 data/ibus.schemas.in.in
@@ -60,7 +61,7 @@ index 074b456..0efaa1b 100644
AM_LDADD = \
@GOBJECT2_LIBS@ \
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 38d6d11..3b2d539 100644
+index 38d6d11..65a034b 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -20,6 +20,10 @@
@@ -114,7 +115,7 @@ index 38d6d11..3b2d539 100644
static void
_config_set_value_done (GObject *object,
GAsyncResult *res,
-@@ -475,8 +505,17 @@ _set_preload_engines (BusIBusImpl *ibus,
+@@ -475,8 +505,21 @@ _set_preload_engines (BusIBusImpl *ibus,
g_variant_unref (value);
}
@@ -125,7 +126,11 @@ index 38d6d11..3b2d539 100644
+ IBusEngineDesc *engine = bus_registry_find_engine_by_name (ibus->registry,
+ DEFAULT_BRIDGE_ENGINE_NAME);
+ g_assert (engine != NULL);
-+ engine_list = g_list_append (engine_list, engine);
++ if (g_list_length (engine_list) > 0) {
++ engine_list = g_list_insert (engine_list, engine, 1);
++ } else {
++ engine_list = g_list_append (engine_list, engine);
++ }
+ ibus->engine_list = engine_list;
+ }
+#endif
@@ -133,7 +138,17 @@ index 38d6d11..3b2d539 100644
if (ibus->engine_list) {
BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) ibus->engine_list->data);
-@@ -1182,28 +1221,110 @@ _ibus_get_address (BusIBusImpl
+@@ -573,7 +616,9 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
+ {
+ GQuark hotkey = g_quark_from_static_string ("trigger");
+ if (value != NULL) {
++#if !USE_BRIDGE_HOTKEY
+ bus_ibus_impl_set_hotkey (ibus, hotkey, value);
++#endif
+ }
+ #ifndef OS_CHROMEOS
+ else {
+@@ -1182,28 +1227,110 @@ _ibus_get_address (BusIBusImpl
g_variant_new ("(s)", bus_server_get_address ()));
}
@@ -261,7 +276,7 @@ index 38d6d11..3b2d539 100644
}
/**
-@@ -1216,7 +1337,39 @@ _context_request_engine_cb (BusInputCont
+@@ -1216,7 +1343,39 @@ _context_request_engine_cb (BusInputCont
const gchar *engine_name,
BusIBusImpl *ibus)
{
@@ -302,7 +317,7 @@ index 38d6d11..3b2d539 100644
}
/**
-@@ -2357,6 +2510,11 @@ bus_ibus_impl_filter_keyboard_shortcuts
+@@ -2357,6 +2516,11 @@ bus_ibus_impl_filter_keyboard_shortcuts
* the same hotkey, then we should switch to the next engine with the
* same hotkey in the list. Otherwise, we just switch to the first
* engine in the list. */
@@ -314,7 +329,7 @@ index 38d6d11..3b2d539 100644
GList *p = engine_list;
for (; p->next != NULL; p = p->next) {
if (current_engine_desc == (IBusEngineDesc *) p->data) {
-@@ -2364,9 +2522,14 @@ bus_ibus_impl_filter_keyboard_shortcuts
+@@ -2364,9 +2528,14 @@ bus_ibus_impl_filter_keyboard_shortcuts
break;
}
}
@@ -329,7 +344,7 @@ index 38d6d11..3b2d539 100644
}
return TRUE;
-@@ -2470,14 +2633,6 @@ static void
+@@ -2470,14 +2639,6 @@ static void
_add_engine_hotkey (IBusEngineDesc *engine, BusIBusImpl *ibus)
{
const gchar *hotkeys;
@@ -344,7 +359,7 @@ index 38d6d11..3b2d539 100644
if (!engine) {
return;
-@@ -2489,40 +2644,7 @@ _add_engine_hotkey (IBusEngineDesc *engi
+@@ -2489,40 +2650,7 @@ _add_engine_hotkey (IBusEngineDesc *engi
return;
}
@@ -592,6 +607,20 @@ index ceeb56d..2694fa3 100644
def introspect(self):
return self.__context.Introspect()
+diff --git a/setup/enginetreeview.py b/setup/enginetreeview.py
+index f620361..727cf89 100644
+--- a/setup/enginetreeview.py
++++ b/setup/enginetreeview.py
+@@ -210,6 +210,9 @@ class EngineTreeView(gtk.TreeView):
+ return
+ row = self.__model[iter]
+ engine = row[0]
++ if ibus.use_bridge_hotkey() and \
++ ibus.DEFAULT_BRIDGE_ENGINE_NAME == engine.name:
++ return
+ self.__engines.remove(engine)
+ index = row.path[0]
+ self.__model.remove(iter)
diff --git a/src/Makefile.am b/src/Makefile.am
index 6454522..443b0db 100644
--- a/src/Makefile.am
diff --git a/ibus.spec b/ibus.spec
index 506d26b..bac90a8 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -13,7 +13,7 @@
Name: ibus
Version: 1.3.99.20110419
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@@ -21,7 +21,7 @@ URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: xinput-ibus
%if %have_gjsfile
-Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/gnome-shell-ibus-plugins-20110621.tar.bz2
+Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/gnome-shell-ibus-plugins-20110622.tar.bz2
%endif
Source3: https://www.transifex.net/projects/p/ibus/resource/master/l/da/download/ibus_master_da.po
Source4: http://ueno.fedorapeople.org/ibus-indicator/ibus-indicator.tar.bz2
@@ -353,7 +353,7 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
-* Mon Jun 20 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-4
+* Mon Jun 20 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110419-5
- Updated ibus-HEAD.patch for upstream.
- Removed ibus-435880-surrounding-text.patch as upstream.
- Added ibus-711632-fedora-fallback-icon.patch
diff --git a/sources b/sources
index 0b35584..ec04f29 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
d4f2729fecb92ae6b41f26c770b1a772 ibus-1.3.99.20110419.tar.gz
-ecd3a320faca906b1b8edaae1988f512 gnome-shell-ibus-plugins-20110621.tar.bz2
+645ed3dd02f663589cdad28e57c25486 gnome-shell-ibus-plugins-20110622.tar.bz2
698c90edf0f037488e1aa969804e891f ibus_master_da.po
23756d25109745bdc1c3a54db370d210 ibus-indicator.tar.bz2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-31 2:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 2:05 [rpms/ibus] autotool: Updated ibus-xx-bridge-hotkey.patch Takao Fujiwara
-- strict thread matches above, loose matches on Subject: below --
2026-05-31 2:05 Takao Fujiwara
2026-05-31 2:05 Takao Fujiwara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox