public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Bumped to 1.5.1
@ 2026-05-31 2:05 Takao Fujiwara
0 siblings, 0 replies; only message 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 : ecac051715f1bd592f47db0560256e099720b6ae
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2013-01-15T19:02:41+09:00
Stats : +659/-2787 in 10 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/ecac051715f1bd592f47db0560256e099720b6ae?branch=autotool
Log:
Bumped to 1.5.1
---
diff --git a/.gitignore b/.gitignore
index 91e9fed..297b080 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ ibus-1.3.6.tar.gz
/ibus-1.3.9.tar.gz
/ibus-1.4.0.tar.gz
/ibus-1.4.1.tar.gz
+/ibus-1.5.1.tar.gz
/ibus-1.3.99.20101028.tar.gz
/ibus-1.3.99.20101118.tar.gz
/ibus-1.3.99.20101202.tar.gz
@@ -49,4 +50,4 @@ ibus-1.3.6.tar.gz
/ibus-gjs-3.4.1.20120428.tar.gz
/ibus-gjs-3.4.1.20120518.tar.gz
/ibus-gjs-3.4.1.20120815.tar.gz
-/ibus-po-1.4.99.20121207.tar.gz
+/ibus-gjs-3.4.1.20130115.tar.gz
diff --git a/ibus-530711-preload-sys.patch b/ibus-530711-preload-sys.patch
index 0870cc1..54b0eec 100644
--- a/ibus-530711-preload-sys.patch
+++ b/ibus-530711-preload-sys.patch
@@ -1,6 +1,6 @@
-From dfe858f7ba476aa878c5d60a7480a03def558463 Mon Sep 17 00:00:00 2001
+From f209d4c3430df3707c432ddfcfc184b791bb50fd Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 27 Nov 2012 15:53:27 +0900
+Date: Fri, 11 Jan 2013 23:03:19 +0900
Subject: [PATCH] Reload preload engines until users customize the list.
The idea is, if users don't customize the preload_engines with ibus-setup,
@@ -25,7 +25,7 @@ IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value
5 files changed, 246 insertions(+), 7 deletions(-)
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index 1a0e2d2..64f6f33 100644
+index 70bf9ca..7833959 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -2,6 +2,30 @@
@@ -60,10 +60,10 @@ index 1a0e2d2..64f6f33 100644
<applyto>/desktop/ibus/general/preload_engines</applyto>
<owner>ibus</owner>
diff --git a/setup/main.py b/setup/main.py
-index c02229b..5da6340 100644
+index 707faa4..aae6bb9 100644
--- a/setup/main.py
+++ b/setup/main.py
-@@ -196,6 +196,20 @@ class Setup(object):
+@@ -190,6 +190,20 @@ class Setup(object):
self.__checkbutton_use_global_engine.connect("toggled",
self.__checkbutton_use_global_engine_toggled_cb)
@@ -83,8 +83,8 @@ index c02229b..5da6340 100644
+
# init engine page
self.__engines = self.__bus.list_engines()
- value = self.__config.get_value("general", "load_xkb_layouts")
-@@ -257,6 +271,7 @@ class Setup(object):
+ self.__combobox = self.__builder.get_object("combobox_engines")
+@@ -243,6 +257,7 @@ class Setup(object):
self.__checkbutton_auto_start_toggled_cb)
self.__config = self.__bus.get_config()
@@ -92,7 +92,7 @@ index c02229b..5da6340 100644
self.__init_hotkey()
self.__init_panel()
-@@ -271,8 +286,8 @@ class Setup(object):
+@@ -251,8 +266,8 @@ class Setup(object):
def __combobox_notify_active_engine_cb(self, combobox, property):
engine = self.__combobox.get_active_engine()
button = self.__builder.get_object("button_engine_add")
@@ -103,7 +103,7 @@ index c02229b..5da6340 100644
def __get_engine_setup_exec_args(self, engine):
args = []
-@@ -351,6 +366,34 @@ class Setup(object):
+@@ -324,6 +339,34 @@ class Setup(object):
del self.__engine_setup_exec_list[name]
self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
@@ -138,7 +138,7 @@ index c02229b..5da6340 100644
def __init_bus(self):
self.__bus = IBus.Bus()
if self.__bus.is_connected():
-@@ -562,8 +605,18 @@ class Setup(object):
+@@ -538,8 +581,18 @@ class Setup(object):
value = GLib.Variant.new_boolean(value)
self.__config.set_value("general", "use_global_engine", value)
@@ -148,7 +148,7 @@ index c02229b..5da6340 100644
+ if section == 'general' and name == 'preload_engines':
+ value = []
+ if variant != None:
-+ value = self.__variant_dup_strv(variant)
++ value = variant.unpack()
+ engines = self.__get_engine_descs_from_names(value)
+ current_engines = self.__treeview.get_engines()
+ engines_csv = str.join(',', map(lambda e: e.get_name(), engines))
@@ -160,10 +160,10 @@ index c02229b..5da6340 100644
def __config_reloaded_cb(self, bus):
pass
diff --git a/setup/setup.ui b/setup/setup.ui
-index 8121d62..2026172 100644
+index e56e917..b3165aa 100644
--- a/setup/setup.ui
+++ b/setup/setup.ui
-@@ -653,7 +653,23 @@
+@@ -669,7 +669,23 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -188,7 +188,7 @@ index 8121d62..2026172 100644
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
-@@ -842,7 +858,7 @@
+@@ -858,7 +874,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@@ -197,7 +197,7 @@ index 8121d62..2026172 100644
</packing>
</child>
<child>
-@@ -889,7 +905,7 @@ You may use up/down buttons to change it.</i></small></property>
+@@ -905,7 +921,7 @@ You may use up/down buttons to change it.</i></small></property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
@@ -228,10 +228,10 @@ index 737b3e2..8ce5a16 100644
* @x: x coordinate.
* @y: y coordinate.
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 63b0cde..c4c8f2c 100644
+index 55b63ce..4717431 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
-@@ -313,6 +313,8 @@ class Panel : IBus.PanelService {
+@@ -291,6 +291,8 @@ class Panel : IBus.PanelService {
if (m_config != null) {
m_config.value_changed.connect(config_value_changed_cb);
m_config.watch("general", "preload_engines");
@@ -239,8 +239,8 @@ index 63b0cde..c4c8f2c 100644
+ m_config.watch("general", "preload_engine_mode");
m_config.watch("general", "engines_order");
m_config.watch("general", "switcher_delay_time");
- m_config.watch("general/hotkey", "trigger_accel");
-@@ -425,7 +427,136 @@ class Panel : IBus.PanelService {
+ m_config.watch("general/hotkey", "triggers");
+@@ -358,7 +360,136 @@ class Panel : IBus.PanelService {
init_gkbd();
}
@@ -377,7 +377,7 @@ index 63b0cde..c4c8f2c 100644
}
private void update_xkb_engines() {
-@@ -591,6 +722,11 @@ class Panel : IBus.PanelService {
+@@ -573,6 +704,11 @@ class Panel : IBus.PanelService {
string section,
string name,
Variant variant) {
diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch
index e72ec44..52e90d0 100644
--- a/ibus-541492-xkb.patch
+++ b/ibus-541492-xkb.patch
@@ -1,40 +1,28 @@
-From 965f09a94744b6374656247ff091eb91b5bad0b2 Mon Sep 17 00:00:00 2001
+From 6772bc0fc82074cd00d56c0e9795d163b489281e Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 10 Dec 2012 16:24:34 +0900
+Date: Fri, 11 Jan 2013 22:55:17 +0900
Subject: [PATCH] Add ibus-xkb and libgnomekbd.
---
bindings/vala/Gkbd-3.0.metadata | 1 +
- bindings/vala/Makefile.am | 23 ++
+ bindings/vala/Makefile.am | 15 ++
bindings/vala/Xkl-1.0.metadata | 3 +
- configure.ac | 68 +++++
- data/ibus.schemas.in | 94 +++++++
- engine/Makefile.am | 6 +
- engine/ibus-xkb/Makefile.am | 61 ++++
- engine/ibus-xkb/ibus-xkb-main.c | 173 ++++++++++++
- engine/ibus-xkb/xkblib.c | 327 ++++++++++++++++++++++
- engine/ibus-xkb/xkblib.h | 41 +++
- engine/main.vala | 86 ++++++
- engine/simple.xml.in.in | 605 +---------------------------------------
- ibus-1.0.pc.in | 4 +
- ibus.spec.in | 12 +
- setup/main.py | 38 ++-
- src/Makefile.am | 5 +
+ configure.ac | 40 ++++
+ data/ibus.schemas.in | 59 +++++
+ ibus-1.0.pc.in | 1 +
+ ibus.spec.in | 12 ++
+ src/Makefile.am | 3 +
src/ibus.h | 1 +
- src/ibusxkbxml.c | 466 +++++++++++++++++++++++++++++++
- src/ibusxkbxml.h | 187 +++++++++++++
- ui/gtk3/Makefile.am | 37 +++
- ui/gtk3/gkbdlayout.vala.false | 63 +++++
- ui/gtk3/gkbdlayout.vala.true | 108 +++++++
- ui/gtk3/panel.vala | 362 ++++++++++++++++++++++--
- ui/gtk3/xkblayout.vala | 465 ++++++++++++++++++++++++++++++
- 24 files changed, 2597 insertions(+), 639 deletions(-)
+ src/ibusxkbxml.c | 466 ++++++++++++++++++++++++++++++++++++++++
+ src/ibusxkbxml.h | 187 ++++++++++++++++
+ ui/gtk3/Makefile.am | 36 ++++
+ ui/gtk3/gkbdlayout.vala.false | 63 ++++++
+ ui/gtk3/gkbdlayout.vala.true | 108 ++++++++++
+ ui/gtk3/panel.vala | 216 ++++++++++++++++++-
+ ui/gtk3/xkblayout.vala | 431 +++++++++++++++++++++++++++++++++++++
+ 16 files changed, 1641 insertions(+), 1 deletion(-)
create mode 100644 bindings/vala/Gkbd-3.0.metadata
create mode 100644 bindings/vala/Xkl-1.0.metadata
- create mode 100644 engine/ibus-xkb/Makefile.am
- create mode 100644 engine/ibus-xkb/ibus-xkb-main.c
- create mode 100644 engine/ibus-xkb/xkblib.c
- create mode 100644 engine/ibus-xkb/xkblib.h
create mode 100644 src/ibusxkbxml.c
create mode 100644 src/ibusxkbxml.h
create mode 100644 ui/gtk3/gkbdlayout.vala.false
@@ -49,37 +37,16 @@ index 0000000..661e6fd
@@ -0,0 +1 @@
+Configuration cheader_filename="libgnomekbd/gkbd-configuration.h"
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
-index abcc543..307a161 100644
+index aba3454..bf3074a 100644
--- a/bindings/vala/Makefile.am
+++ b/bindings/vala/Makefile.am
-@@ -27,12 +27,22 @@ dist_vapi_DATA = \
+@@ -28,6 +28,17 @@ vapi_deps = \
+ $(top_builddir)/src/IBus-1.0.gir \
$(NULL)
- # Don't rebuild vapi every time gir is updated.
-+if ENABLE_LIBGNOMEKBD
- vapi_deps = \
- $(srcdir)/IBus-1.0.metadata \
- $(srcdir)/IBus-1.0-custom.vala \
- | \
-+ $(builddir)/gkbd.vapi \
- $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
- $(NULL)
-+else
-+vapi_deps = \
-+ $(srcdir)/IBus-1.0.metadata \
-+ $(srcdir)/IBus-1.0-custom.vala \
-+ | \
-+ $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
-+ $(NULL)
-+endif
-
- ibus-@IBUS_API_VERSION@.vapi: $(vapi_deps)
- $(AM_V_GEN) $(VAPIGEN) --library ibus-@IBUS_API_VERSION@ \
-@@ -41,13 +51,26 @@ ibus-@IBUS_API_VERSION@.vapi: $(vapi_deps)
- $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
- $(srcdir)/IBus-1.0-custom.vala
-
+if ENABLE_LIBGNOMEKBD
++vapi_deps += $(builddir)/gkbd.vapi
++
+$(builddir)/gkbd.vapi:
+ $(AM_V_GEN) $(VAPIGEN) --library gkbd \
+ --metadatadir $(srcdir) \
@@ -88,10 +55,17 @@ index abcc543..307a161 100644
+ $(NULL)
+endif
+
+ ibus-1.0.vapi: $(vapi_deps)
+
+ VAPIGEN_VAPIS = ibus-1.0.vapi
+@@ -43,11 +54,15 @@ vapidir = $(datadir)/vala/vapi
+ vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
+
EXTRA_DIST = \
+ Gkbd-3.0.metadata \
IBus-1.0.metadata \
IBus-1.0-custom.vala \
+ ibus-1.0.deps \
config.vapi \
xi.vapi \
+ Xkl-1.0.metadata \
@@ -99,8 +73,6 @@ index abcc543..307a161 100644
+CLEANFILES = gkbd.vapi
+
- MAINTAINERCLEANFILES = ibus-@IBUS_API_VERSION@.vapi
-
-include $(top_srcdir)/git.mk
diff --git a/bindings/vala/Xkl-1.0.metadata b/bindings/vala/Xkl-1.0.metadata
new file mode 100644
@@ -112,44 +84,18 @@ index 0000000..4961d0c
+Engine
+ .filter_events.evt ref type="X.Event"
diff --git a/configure.ac b/configure.ac
-index cc7d0e0..246b3fc 100644
+index b328073..61d1464 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -252,6 +252,71 @@ else
+@@ -237,6 +237,45 @@ else
enable_xim="no (disabled, use --enable-xim to enable)"
fi
+# Option for XKB command.
-+AC_ARG_WITH(xkb-command,
-+ AS_HELP_STRING([--with-xkb-command[=XKB_COMMAND]],
-+ [Use XKB_COMMAND to set keymap. ibus-xkb is available. (default is setxkbmap)]),
-+ XKB_COMMAND=$with_xkb_command,
-+ XKB_COMMAND=setxkbmap
++PKG_CHECK_MODULES(XKB,
++ [xkbfile],,
++ [XKB_LIBS="-lxkbfile"]
+)
-+AC_DEFINE_UNQUOTED(XKB_COMMAND, "$XKB_COMMAND",
-+ [xkb command line to set xkb keymaps.])
-+
-+if test x"$XKB_COMMAND" = x"ibus-xkb"; then
-+ enable_ibus_xkb=yes
-+else
-+ enable_ibus_xkb=no
-+fi
-+
-+AM_CONDITIONAL([ENABLE_IBUS_XKB], [test x"$enable_ibus_xkb" = x"yes"])
-+if test x"$enable_ibus_xkb" = x"yes"; then
-+ PKG_CHECK_MODULES(X11, [
-+ x11
-+ ])
-+ PKG_CHECK_MODULES(XKB,
-+ [xkbfile],,
-+ [XKB_LIBS="-lxkbfile"]
-+ )
-+ AC_DEFINE(HAVE_IBUS_XKB, 1, [define to 1 if you have xkbfile])
-+ HAVE_IBUS_XKB=true
-+else
-+ HAVE_IBUS_XKB=false
-+fi
-+AC_SUBST(HAVE_IBUS_XKB)
+
+# --enable-libgnomekbd option.
+AC_ARG_ENABLE(libgnomekbd,
@@ -187,25 +133,16 @@ index cc7d0e0..246b3fc 100644
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([0.6.8])
-@@ -517,6 +582,7 @@ src/ibusversion.h
- src/tests/Makefile
- bus/Makefile
- engine/Makefile
-+engine/ibus-xkb/Makefile
- engine/simple.xml.in
- util/Makefile
- util/IMdkit/Makefile
-@@ -576,6 +642,8 @@ Build options:
+@@ -579,6 +618,7 @@ Build options:
No snooper regexes "$NO_SNOOPER_APPS"
Panel icon "$IBUS_ICON_KEYBOARD"
Enable surrounding-text $enable_surrounding_text
-+ XKB command $XKB_COMMAND
+ Build libgnomebkd $enable_libgnomekbd
Run test cases $enable_tests
])
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index a8c7d7f..1a0e2d2 100644
+index dbb6da8..70bf9ca 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -42,6 +42,52 @@
@@ -261,1436 +198,34 @@ index a8c7d7f..1a0e2d2 100644
<key>/schemas/desktop/ibus/general/hotkey/trigger</key>
<applyto>/desktop/ibus/general/hotkey/trigger</applyto>
<owner>ibus</owner>
-@@ -50,6 +96,54 @@
- <default>[Control+space,Zenkaku_Hankaku,Alt+Kanji,Alt+grave,Hangul,Alt+Release+Alt_R]</default>
- <locale name="C">
- <short>Trigger shortcut keys</short>
-+ <long>The shortcut keys for turning input method on or off</long>
-+ </locale>
-+ </schema>
-+ <schema>
-+ <key>/schemas/desktop/ibus/general/hotkey/trigger_accel</key>
-+ <applyto>/desktop/ibus/general/hotkey/trigger_accel</applyto>
-+ <owner>ibus</owner>
-+ <type>list</type>
-+ <list_type>string</list_type>
-+ <default>[<Control>space]</default>
-+ <locale name="C">
-+ <short>Trigger shortcut keys for gtk_accelerator_parse</short>
-+ <long>The shortcut keys for turning input method on or off</long>
-+ </locale>
-+ </schema>
-+ <schema>
-+ <key>/schemas/desktop/ibus/general/hotkey/trigger_accel_backward</key>
-+ <applyto>/desktop/ibus/general/hotkey/trigger_accel_backward</applyto>
-+ <owner>ibus</owner>
-+ <type>list</type>
-+ <list_type>string</list_type>
-+ <default>[<Control><Shift>space]</default>
-+ <locale name="C">
-+ <short>Trigger reverse shortcut keys for gtk_accelerator_parse</short>
-+ <long>The reverse shortcut keys for turning input method on or off</long>
-+ </locale>
-+ </schema>
-+ <schema>
-+ <key>/schemas/desktop/ibus/general/hotkey/trigger_ja</key>
-+ <applyto>/desktop/ibus/general/hotkey/trigger_ja</applyto>
+@@ -66,6 +112,19 @@
+ </locale>
+ </schema>
+ <schema>
++ <key>/schemas/desktop/ibus/general/hotkey/triggers-no-modifiers</key>
++ <applyto>/desktop/ibus/general/hotkey/triggers-no-modifiers</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
-+ <default>[Zenkaku_Hankaku]</default>
++ <default>[]</default>
+ <locale name="C">
-+ <short>Trigger shortcut keys for ja gtk_accelerator_parse</short>
-+ <long>The shortcut keys for turning input method on or off</long>
++ <short>Trigger shortcut keys without modifier keys</short>
++ <long>Trigger shortcut keys without modifier keys.
++ The list is used by ibus-gjs.</long>
+ </locale>
+ </schema>
+ <schema>
-+ <key>/schemas/desktop/ibus/general/hotkey/trigger_ko</key>
-+ <applyto>/desktop/ibus/general/hotkey/trigger_ko</applyto>
-+ <owner>ibus</owner>
-+ <type>list</type>
-+ <list_type>string</list_type>
-+ <default>[Hangul, Alt_R]</default>
-+ <locale name="C">
-+ <short>Trigger shortcut keys for ko gtk_accelerator_parse</short>
- <long>The shortcut keys for turning input method on or off</long>
- </locale>
- </schema>
-diff --git a/engine/Makefile.am b/engine/Makefile.am
-index b3b46be..90c6fde 100644
---- a/engine/Makefile.am
-+++ b/engine/Makefile.am
-@@ -22,6 +22,12 @@
-
- libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la
-
-+SUBDIRS =
-+
-+if ENABLE_IBUS_XKB
-+SUBDIRS += ibus-xkb
-+endif
-+
- INCLUDES = \
- -I$(top_srcdir)/src \
- -I$(top_builddir)/src \
-diff --git a/engine/ibus-xkb/Makefile.am b/engine/ibus-xkb/Makefile.am
-new file mode 100644
-index 0000000..4a32e87
---- /dev/null
-+++ b/engine/ibus-xkb/Makefile.am
-@@ -0,0 +1,61 @@
-+# vim:set noet ts=4:
-+#
-+# ibus - The Input Bus
-+#
-+# Copyright (c) 2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2012 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
-+
-+libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la
-+
-+INCLUDES = \
-+ -I$(top_srcdir)/src \
-+ -I$(top_builddir)/src \
-+ $(NULL)
-+
-+AM_CFLAGS = \
-+ $(INCLUDES) \
-+ -DG_LOG_DOMAIN=\"IBUS\" \
-+ -DIBUS_DISABLE_DEPRECATED \
-+ -Wno-unused-variable \
-+ -Wno-unused-but-set-variable \
-+ -Wno-unused-function \
-+ $(NULL)
-+
-+libexec_PROGRAMS = ibus-xkb
-+
-+ibus_xkb_SOURCES = \
-+ ibus-xkb-main.c \
-+ xkblib.h \
-+ xkblib.c \
-+ $(NULL)
-+ibus_xkb_CFLAGS = \
-+ @XKB_CFLAGS@ \
-+ @X11_CFLAGS@ \
-+ @GLIB2_CFLAGS@ \
-+ $(NULL)
-+ibus_xkb_LDADD = \
-+ @XKB_LIBS@ \
-+ @X11_LIBS@ \
-+ @GLIB2_LIBS@ \
-+ $(libibus) \
-+ $(NULL)
-+
-+$(libibus):
-+ $(MAKE) -C $(top_builddir)/src
-+
-+-include $(top_srcdir)/git.mk
-diff --git a/engine/ibus-xkb/ibus-xkb-main.c b/engine/ibus-xkb/ibus-xkb-main.c
-new file mode 100644
-index 0000000..3dfd987
---- /dev/null
-+++ b/engine/ibus-xkb/ibus-xkb-main.c
-@@ -0,0 +1,173 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2012 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2012 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 library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include <glib.h>
-+#include <glib/gprintf.h>
-+#include <glib/gi18n.h>
-+#include <X11/Xlib.h>
-+
-+#ifdef ENABLE_NLS
-+#include <locale.h>
-+#endif
-+
-+#include "xkblib.h"
-+
-+static gboolean query = FALSE;
-+static gboolean get_group = FALSE;
-+static gchar *layout = NULL;
-+static gchar *variant = NULL;
-+static gchar *option = NULL;
-+static int group = 0;
-+
-+static const GOptionEntry entries[] =
-+{
-+ { "get", 'g', 0, G_OPTION_ARG_NONE, &query, N_("Query the current xkb layout"), NULL },
-+ { "layout", 'l', 0, G_OPTION_ARG_STRING, &layout, N_("Set xkb LAYOUT"), N_("LAYOUT") },
-+ { "variant", 'v', 0, G_OPTION_ARG_STRING, &variant, N_("Set xkb VARIANT"), N_("VARIANT") },
-+ { "option", 'o', 0, G_OPTION_ARG_STRING, &option, N_("Set xkb OPTION"), N_("OPTION") },
-+ { "get-group", 'G', 0, G_OPTION_ARG_NONE, &get_group, N_("Get current xkb state"), NULL },
-+ { NULL },
-+};
-+
-+
-+gboolean
-+parse_setxkbmap_args (int *pargc, char ***pargv)
-+{
-+ int argc = *pargc;
-+ char **argv = *pargv;
-+ char **new_argv = NULL;
-+ int n = 1;
-+ int i;
-+ gboolean retval = FALSE;
-+
-+ for (i = 0; i < argc; i++) {
-+ if (g_strcmp0 (argv[i], "-layout") == 0 && i + 1 < argc) {
-+ g_free (layout);
-+ layout = g_strdup (argv[i + 1]);
-+ i++;
-+ retval = TRUE;
-+ continue;
-+ }
-+ if (g_strcmp0 (argv[i], "-variant") == 0 && i + 1 < argc) {
-+ g_free (variant);
-+ variant = g_strdup (argv[i + 1]);
-+ i++;
-+ retval = TRUE;
-+ continue;
-+ }
-+ if (g_strcmp0 (argv[i], "-option") == 0 && i + 1 < argc) {
-+ g_free (option);
-+ option = g_strdup (argv[i + 1]);
-+ i++;
-+ retval = TRUE;
-+ continue;
-+ }
-+ if (g_strcmp0 (argv[i], "-query") == 0) {
-+ query = TRUE;
-+ retval = TRUE;
-+ continue;
-+ }
-+
-+ new_argv = g_renew(char*, new_argv, n);
-+ new_argv[n - 1] = g_strdup (argv[i]);
-+ n++;
-+ }
-+
-+ *pargc = n - 1;
-+ *pargv = new_argv;
-+
-+ return retval;
-+}
-+
-+int
-+main (int argc, char *argv[])
-+{
-+ gboolean parsed;
-+ GOptionContext *context;
-+ GError *error = NULL;
-+ Display *xdisplay;
-+
-+#ifdef ENABLE_NLS
-+ setlocale (LC_ALL, "");
-+
-+ bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
-+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-+#endif
-+
-+ parsed = parse_setxkbmap_args (&argc, &argv);
-+
-+ context = g_option_context_new ("- ibus daemon");
-+
-+ g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
-+ g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
-+
-+ if (!parsed && !g_option_context_parse (context, &argc, &argv, &error)) {
-+ g_printerr ("Option parsing failed: %s\n", error->message);
-+ return -1;
-+ }
-+
-+ xdisplay = XOpenDisplay (NULL);
-+ if (xdisplay == NULL) {
-+ g_warning ("Could not open display");
-+ return -1;
-+ }
-+ ibus_xkb_init (xdisplay);
-+
-+ if (layout) {
-+ if (option == NULL) {
-+ option = ibus_xkb_get_current_option ();
-+ }
-+
-+ ibus_xkb_set_layout (layout, variant, option);
-+ }
-+
-+ if (query) {
-+ g_free (layout);
-+ g_free (variant);
-+ g_free (option);
-+
-+ layout = ibus_xkb_get_current_layout ();
-+ variant = ibus_xkb_get_current_variant ();
-+ option = ibus_xkb_get_current_option ();
-+ g_printf ("layout: %s\n"
-+ "variant: %s\n"
-+ "option: %s\n",
-+ layout ? layout : "",
-+ variant ? variant : "",
-+ option ? option : "");
-+ g_free (layout);
-+ g_free (variant);
-+ g_free (option);
-+ }
-+ if (get_group) {
-+ group = ibus_xkb_get_current_group ();
-+ g_printf ("group: %d\n", group);
-+ }
-+
-+ ibus_xkb_finit ();
-+
-+ return 0;
-+}
-diff --git a/engine/ibus-xkb/xkblib.c b/engine/ibus-xkb/xkblib.c
-new file mode 100644
-index 0000000..bb25455
---- /dev/null
-+++ b/engine/ibus-xkb/xkblib.c
-@@ -0,0 +1,327 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2012 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2012 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 library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include <glib.h>
-+#include <X11/Xlib.h>
-+#include <X11/Xatom.h>
-+#include <X11/XKBlib.h>
-+#include <stdio.h> /* for XKBrules.h */
-+#include <X11/extensions/XKBrules.h>
-+#include <X11/extensions/XKBstr.h>
-+#include <string.h>
-+
-+#include "xkblib.h"
-+
-+#ifndef XKB_RULES_XML_FILE
-+#define XKB_RULES_XML_FILE "/usr/share/X11/xkb/rules/evdev.xml"
-+#endif
-+
-+static gchar **default_layouts;
-+static gchar **default_variants;
-+static gchar **default_options;
-+static int default_layout_group;
-+
-+static Display *
-+get_xdisplay (Display *xdisplay)
-+{
-+ static Display *saved_xdisplay = NULL;
-+ if (xdisplay != NULL) {
-+ saved_xdisplay = xdisplay;
-+ }
-+ return saved_xdisplay;
-+}
-+
-+static void
-+init_xkb_default_layouts (Display *xdisplay)
-+{
-+ XkbStateRec state;
-+ Atom xkb_rules_name, type;
-+ int format;
-+ unsigned long l, nitems, bytes_after;
-+ unsigned char *prop = NULL;
-+
-+ xkb_rules_name = XInternAtom (xdisplay, "_XKB_RULES_NAMES", TRUE);
-+ if (xkb_rules_name == None) {
-+ g_warning ("Could not get XKB rules atom");
-+ return;
-+ }
-+ if (XGetWindowProperty (xdisplay,
-+ XDefaultRootWindow (xdisplay),
-+ xkb_rules_name,
-+ 0, 1024, FALSE, XA_STRING,
-+ &type, &format, &nitems, &bytes_after, &prop) != Success) {
-+ g_warning ("Could not get X property");
-+ return;
-+ }
-+ if (nitems < 3) {
-+ g_warning ("Could not get group layout from X property");
-+ return;
-+ }
-+ for (l = 0; l < 2; l++) {
-+ prop += strlen ((const char *) prop) + 1;
-+ }
-+ if (prop == NULL || *prop == '\0') {
-+ g_warning ("No layouts form X property");
-+ return;
-+ }
-+ default_layouts = g_strsplit ((gchar *) prop, ",", -1);
-+ prop += strlen ((const char *) prop) + 1;
-+ default_variants = g_strsplit ((gchar *) prop, ",", -1);
-+ prop += strlen ((const char *) prop) + 1;
-+ default_options = g_strsplit ((gchar *) prop, ",", -1);
-+
-+ if (XkbGetState (xdisplay, XkbUseCoreKbd, &state) != Success) {
-+ g_warning ("Could not get state");
-+ return;
-+ }
-+ default_layout_group = state.group;
-+}
-+
-+static Bool
-+set_xkb_rules (Display *xdisplay,
-+ const char *rules_file, const char *model,
-+ const char *all_layouts, const char *all_variants,
-+ const char *all_options)
-+{
-+ gchar *rules_path;
-+ XkbRF_RulesPtr rules;
-+ XkbRF_VarDefsRec rdefs;
-+ XkbComponentNamesRec rnames;
-+ XkbDescPtr xkb;
-+
-+ rules_path = g_strdup ("./rules/evdev");
-+ rules = XkbRF_Load (rules_path, "C", TRUE, TRUE);
-+ if (rules == NULL) {
-+ g_return_val_if_fail (XKB_RULES_XML_FILE != NULL, FALSE);
-+
-+ g_free (rules_path);
-+ if (g_str_has_suffix (XKB_RULES_XML_FILE, ".xml")) {
-+ rules_path = g_strndup (XKB_RULES_XML_FILE,
-+ strlen (XKB_RULES_XML_FILE) - 4);
-+ } else {
-+ rules_path = g_strdup (XKB_RULES_XML_FILE);
-+ }
-+ rules = XkbRF_Load (rules_path, "C", TRUE, TRUE);
-+ }
-+ g_return_val_if_fail (rules != NULL, FALSE);
-+
-+ memset (&rdefs, 0, sizeof (XkbRF_VarDefsRec));
-+ memset (&rnames, 0, sizeof (XkbComponentNamesRec));
-+ rdefs.model = model ? g_strdup (model) : NULL;
-+ rdefs.layout = all_layouts ? g_strdup (all_layouts) : NULL;
-+ rdefs.variant = all_variants ? g_strdup (all_variants) : NULL;
-+ rdefs.options = all_options ? g_strdup (all_options) : NULL;
-+ XkbRF_GetComponents (rules, &rdefs, &rnames);
-+ xkb = XkbGetKeyboardByName (xdisplay, XkbUseCoreKbd, &rnames,
-+ XkbGBN_AllComponentsMask,
-+ XkbGBN_AllComponentsMask &
-+ (~XkbGBN_GeometryMask), True);
-+ if (!xkb) {
-+ g_warning ("Cannot load new keyboard description.");
-+ return FALSE;
-+ }
-+ XkbRF_SetNamesProp (xdisplay, rules_path, &rdefs);
-+ g_free (rules_path);
-+ g_free (rdefs.model);
-+ g_free (rdefs.layout);
-+ g_free (rdefs.variant);
-+ g_free (rdefs.options);
-+
-+ return TRUE;
-+}
-+
-+static Bool
-+update_xkb_properties (Display *xdisplay,
-+ const char *rules_file, const char *model,
-+ const char *all_layouts, const char *all_variants,
-+ const char *all_options)
-+{
-+ int len;
-+ char *pval;
-+ char *next;
-+ Atom rules_atom;
-+ Window root_window;
-+
-+ len = (rules_file ? strlen (rules_file) : 0);
-+ len += (model ? strlen (model) : 0);
-+ len += (all_layouts ? strlen (all_layouts) : 0);
-+ len += (all_variants ? strlen (all_variants) : 0);
-+ len += (all_options ? strlen (all_options) : 0);
-+
-+ if (len < 1) {
-+ return TRUE;
-+ }
-+ len += 5; /* trailing NULs */
-+
-+ rules_atom = XInternAtom (xdisplay, _XKB_RF_NAMES_PROP_ATOM, False);
-+ root_window = XDefaultRootWindow (xdisplay);
-+ pval = next = g_new0 (char, len + 1);
-+ if (!pval) {
-+ return TRUE;
-+ }
-+
-+ if (rules_file) {
-+ strcpy (next, rules_file);
-+ next += strlen (rules_file);
-+ }
-+ *next++ = '\0';
-+ if (model) {
-+ strcpy (next, model);
-+ next += strlen (model);
-+ }
-+ *next++ = '\0';
-+ if (all_layouts) {
-+ strcpy (next, all_layouts);
-+ next += strlen (all_layouts);
-+ }
-+ *next++ = '\0';
-+ if (all_variants) {
-+ strcpy (next, all_variants);
-+ next += strlen (all_variants);
-+ }
-+ *next++ = '\0';
-+ if (all_options) {
-+ strcpy (next, all_options);
-+ next += strlen (all_options);
-+ }
-+ *next++ = '\0';
-+ if ((next - pval) != len) {
-+ g_free (pval);
-+ return TRUE;
-+ }
-+
-+ XChangeProperty (xdisplay, root_window,
-+ rules_atom, XA_STRING, 8, PropModeReplace,
-+ (unsigned char *) pval, len);
-+ XSync(xdisplay, False);
-+
-+ return TRUE;
-+}
-+
-+void
-+ibus_xkb_init (Display *xdisplay)
-+{
-+ get_xdisplay (xdisplay);
-+ init_xkb_default_layouts (xdisplay);
-+}
-+
-+void
-+ibus_xkb_finit (void)
-+{
-+ g_strfreev (default_layouts);
-+ default_layouts = NULL;
-+ g_strfreev (default_variants);
-+ default_variants = NULL;
-+ g_strfreev (default_options);
-+ default_options = NULL;
-+}
-+
-+gchar *
-+ibus_xkb_get_current_layout (void)
-+{
-+ if (default_layouts == NULL) {
-+ g_warning ("Your system seems not to support XKB.");
-+ return NULL;
-+ }
-+
-+ return g_strjoinv (",", (gchar **) default_layouts);
-+}
-+
-+gchar *
-+ibus_xkb_get_current_variant (void)
-+{
-+ if (default_variants == NULL) {
-+ return NULL;
-+ }
-+
-+ return g_strjoinv (",", (gchar **) default_variants);
-+}
-+
-+gchar *
-+ibus_xkb_get_current_option (void)
-+{
-+ if (default_options == NULL) {
-+ return NULL;
-+ }
-+
-+ return g_strjoinv (",", (gchar **) default_options);
-+}
-+
-+gboolean
-+ibus_xkb_set_layout (const char *layouts,
-+ const char *variants,
-+ const char *options)
-+{
-+ Display *xdisplay;
-+ gboolean retval;
-+ gchar *layouts_line;
-+
-+ if (default_layouts == NULL) {
-+ g_warning ("Your system seems not to support XKB.");
-+ return FALSE;
-+ }
-+
-+ if (layouts == NULL || g_strcmp0 (layouts, "default") == 0) {
-+ layouts_line = g_strjoinv (",", (gchar **) default_layouts);
-+ } else {
-+ layouts_line = g_strdup (layouts);
-+ }
-+
-+ xdisplay = get_xdisplay (NULL);
-+ retval = set_xkb_rules (xdisplay,
-+ "evdev", "evdev",
-+ layouts_line, variants, options);
-+ update_xkb_properties (xdisplay,
-+ "evdev", "evdev",
-+ layouts_line, variants, options);
-+ g_free (layouts_line);
-+
-+ return retval;
-+}
-+
-+int
-+ibus_xkb_get_current_group (void)
-+{
-+ Display *xdisplay = get_xdisplay (NULL);
-+ XkbStateRec state;
-+
-+ if (default_layouts == NULL) {
-+ g_warning ("Your system seems not to support XKB.");
-+ return 0;
-+ }
-+
-+ if (xdisplay == NULL) {
-+ g_warning ("ibus-xkb is not initialized.");
-+ return 0;
-+ }
-+
-+ if (XkbGetState (xdisplay, XkbUseCoreKbd, &state) != Success) {
-+ g_warning ("Could not get state");
-+ return 0;
-+ }
-+
-+ return state.group;
-+}
-diff --git a/engine/ibus-xkb/xkblib.h b/engine/ibus-xkb/xkblib.h
-new file mode 100644
-index 0000000..36597c3
---- /dev/null
-+++ b/engine/ibus-xkb/xkblib.h
-@@ -0,0 +1,41 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2012 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2012 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 library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifndef __XKBLIB_H_
-+#define __XKBLIB_H_
-+
-+#include <X11/Xlib.h>
-+
-+G_BEGIN_DECLS
-+
-+void ibus_xkb_init (Display *xdisplay);
-+void ibus_xkb_finit (void);
-+gchar *ibus_xkb_get_current_layout (void);
-+gchar *ibus_xkb_get_current_variant (void);
-+gchar *ibus_xkb_get_current_option (void);
-+gboolean ibus_xkb_set_layout (const char *layouts,
-+ const char *variants,
-+ const char *options);
-+int ibus_xkb_get_current_group (void);
-+
-+G_END_DECLS
-+#endif
-diff --git a/engine/main.vala b/engine/main.vala
-index acfa737..afadca0 100644
---- a/engine/main.vala
-+++ b/engine/main.vala
-@@ -21,6 +21,85 @@
- */
-
- using IBus;
-+using GLib;
-+
-+private void print_xml(string layout,
-+ string layout_desc,
-+ string? variant,
-+ string? variant_desc,
-+ string lang) {
-+ string name = "xkb:%s:%s:%s".printf(layout, variant ?? "", lang);
-+ string keymap = layout;
-+ string desc = layout_desc;
-+ string symbol = lang;
-+
-+ if (variant != null) {
-+ keymap = "%s(%s)".printf(layout, variant);
-+ }
-+
-+ if (variant_desc != null) {
-+ desc = variant_desc;
-+ }
-+
-+ desc = desc.replace("<", "<").replace(">", ">");
-+
-+ if (lang.length > 2) {
-+ symbol = lang[0:2];
-+ }
-+
-+ string engine = "
-+ <engine>
-+ <name>%s</name>
-+ <language>%s</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>%s</layout>
-+ <longname>%s</longname>
-+ <description>%s</description>
-+ <icon>ibus-keyboard</icon>
-+ <symbol>%s</symbol>
-+ <rank>%d</rank>
-+ </engine>".printf(name, lang, keymap, desc, desc, symbol, 99);
-+ print (engine);
-+}
-+
-+private void print_component() {
-+ IBus.XKBConfigRegistry registry = new IBus.XKBConfigRegistry();
-+ GLib.List layouts = registry.layout_list_get_layouts();
-+ GLib.List variants;
-+ GLib.List langs;
-+ string layout_desc;
-+ const string header = "<engines>";
-+ const string footer = "
-+</engines>";
-+
-+ print (header);
-+ for (unowned GLib.List<string> l = layouts; l != null; l = l.next) {
-+ variants = registry.layout_list_get_variants(l.data);
-+ langs = registry.layout_lang_get_langs(l.data);
-+ layout_desc = registry.layout_desc_get_desc(l.data);
-+ for (unowned GLib.List<string> lg = langs; lg != null; lg = lg.next) {
-+ print_xml(l.data, layout_desc, null, null, lg.data);
-+ }
-+ for (unowned GLib.List<string> v = variants; v != null; v = v.next) {
-+ var l_v = "%s(%s)".printf(l.data, v.data);
-+ unowned GLib.List<string> l_v_langs = null;
-+ GLib.List<string> _l_v_langs = registry.layout_lang_get_langs(l_v);
-+ l_v_langs = _l_v_langs;
-+ if (l_v_langs == null) {
-+ l_v_langs = langs;
-+ }
-+ for (unowned GLib.List<string> lg = l_v_langs; lg != null; lg = lg.next) {
-+ print_xml(l.data,
-+ layout_desc,
-+ v.data,
-+ registry.variant_desc_get_desc(l_v),
-+ lg.data);
-+ }
-+ }
-+ }
-+ print (footer);
-+}
-
- class DummyEngine : IBus.EngineSimple {
- }
-@@ -28,6 +107,13 @@ class DummyEngine : IBus.EngineSimple {
- public int main(string[] args) {
- IBus.init();
-
-+ if (args.length >= 2) {
-+ if (args[1] == "--xml" || args[1] == "-x") {
-+ print_component();
-+ return 0;
-+ }
-+ }
-+
- IBus.Bus bus = new IBus.Bus();
- if (!bus.is_connected()) {
- warning("ibus-daemon does not exist.");
-diff --git a/engine/simple.xml.in.in b/engine/simple.xml.in.in
-index d064ad6..d14ad93 100644
---- a/engine/simple.xml.in.in
-+++ b/engine/simple.xml.in.in
-@@ -7,608 +7,5 @@
- <license>GPL</license>
- <homepage>http://code.google.com/p/ibus</homepage>
- <textdomain>ibus</textdomain>
-- <engines>
-- <engine>
-- <name>xkb:us::eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us</layout>
-- <longname>English (US)</longname>
-- <description>English (US)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:us:intl:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us</layout>
-- <layout_variant>intl</layout_variant>
-- <longname>English (US, international with dead keys)</longname>
-- <description>English (US, international with dead keys)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:us:colemak:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us</layout>
-- <layout_variant>colemak</layout_variant>
-- <longname>English (Colemak)</longname>
-- <description>English (Colemak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:us:dvorak:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>English (Dvorak)</longname>
-- <description>English (Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:us:altgr-intl:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us</layout>
-- <layout_variant>altgr-intl</layout_variant>
-- <longname>English (international AltGr dead keys)</longname>
-- <description>English (international AltGr dead keys)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ara::ara</name>
-- <language>ara</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ara</layout>
-- <longname>Arabic</longname>
-- <description>Arabic</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:be::ger</name>
-- <language>ger</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>be</layout>
-- <longname>Belgian</longname>
-- <description>Belgian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:be::nld</name>
-- <language>nld</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>be</layout>
-- <longname>Belgian</longname>
-- <description>Belgian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:be::fra</name>
-- <language>fra</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>be</layout>
-- <longname>Belgian</longname>
-- <description>Belgian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:br::por</name>
-- <language>por</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>br</layout>
-- <longname>Portuguese (Brazil)</longname>
-- <description>Portuguese (Brazil)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:br:dvorak:por</name>
-- <language>por</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>br</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>Portuguese (Brazil, Dvorak)</longname>
-- <description>Portuguese (Brazil, Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:bg::bul</name>
-- <language>bul</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>bg</layout>
-- <longname>Bulgarian</longname>
-- <description>Bulgarian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:bg:phonetic:bul</name>
-- <language>bul</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>bg</layout>
-- <layout_variant>phonetic</layout_variant>
-- <longname>Bulgarian (traditional phonetic)</longname>
-- <description>Bulgarian (traditional phonetic)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ca::fra</name>
-- <language>fra</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ca</layout>
-- <longname>French (Canada)</longname>
-- <description>French (Canada)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ca:eng:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ca</layout>
-- <layout_variant>eng</layout_variant>
-- <longname>English (Canada)</longname>
-- <description>English (Canada)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:hr::scr</name>
-- <language>scr</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>hr</layout>
-- <longname>Croatian</longname>
-- <description>Croatian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:cz::cze</name>
-- <language>cze</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>cz</layout>
-- <longname>Czech</longname>
-- <description>Czech</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:dk::dan</name>
-- <language>dan</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>dk</layout>
-- <longname>Danish</longname>
-- <description>Danish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ee::est</name>
-- <language>est</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ee</layout>
-- <longname>Estonian</longname>
-- <description>Estonian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:fi::fin</name>
-- <language>fin</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>fi</layout>
-- <longname>Finnish</longname>
-- <description>Finnish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:fr::fra</name>
-- <language>fra</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>fr</layout>
-- <longname>French</longname>
-- <description>French</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:fr:dvorak:fra</name>
-- <language>fra</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>fr</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>French (Dvorak)</longname>
-- <description>French (Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:de::ger</name>
-- <language>ger</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>de</layout>
-- <longname>German</longname>
-- <description>German</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:de:dvorak:ger</name>
-- <language>ger</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>de</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>German (Dvorak)</longname>
-- <description>German (Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:de:neo:ger</name>
-- <language>ger</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>de</layout>
-- <layout_variant>neo</layout_variant>
-- <longname>German (Neo 2)</longname>
-- <description>German (Neo 2)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:gr::gre</name>
-- <language>gre</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gr</layout>
-- <longname>Greek</longname>
-- <description>Greek</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:hu::hun</name>
-- <language>hun</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>hu</layout>
-- <longname>Hungarian</longname>
-- <description>Hungarian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:il::heb</name>
-- <language>heb</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>il</layout>
-- <longname>Hebrew</longname>
-- <description>Hebrew</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:it::ita</name>
-- <language>ita</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>it</layout>
-- <longname>Italian</longname>
-- <description>Italian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:jp::jpn</name>
-- <language>jpn</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>jp</layout>
-- <longname>Japanese</longname>
-- <description>Japanese</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:latam::spa</name>
-- <language>spa</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>latam</layout>
-- <longname>Spanish (Latin American)</longname>
-- <description>Spanish (Latin American)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:lt::lit</name>
-- <language>lit</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>lt</layout>
-- <longname>Lithuanian</longname>
-- <description>Lithuanian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:lv:apostrophe:lav</name>
-- <language>lav</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>lv</layout>
-- <layout_variant>apostrophe</layout_variant>
-- <longname>Latvian (apostrophe variant)</longname>
-- <description>Latvian (apostrophe variant)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:pl::pol</name>
-- <language>pol</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>pl</layout>
-- <longname>Polish</longname>
-- <description>Polish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:pl:dvorak:pol</name>
-- <language>pol</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>pl</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>Polish (Dvorak)</longname>
-- <description>Polish (Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:pt::por</name>
-- <language>por</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>pt</layout>
-- <longname>Portuguese</longname>
-- <description>Portuguese</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ro::rum</name>
-- <language>rum</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ro</layout>
-- <longname>Romanian</longname>
-- <description>Romanian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ru::rus</name>
-- <language>rus</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ru</layout>
-- <longname>Russian</longname>
-- <description>Russian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ru:phonetic:rus</name>
-- <language>rus</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ru</layout>
-- <layout_variant>phonetic</layout_variant>
-- <longname>Russian (phonetic)</longname>
-- <description>Russian (phonetic)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:rs::srp</name>
-- <language>srp</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>rs</layout>
-- <longname>Serbian</longname>
-- <description>Serbian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:si::slv</name>
-- <language>slv</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>si</layout>
-- <longname>Slovenian</longname>
-- <description>Slovenian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:sk::slo</name>
-- <language>slo</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>sk</layout>
-- <longname>Slovak</longname>
-- <description>Slovak</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:es::spa</name>
-- <language>spa</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>es</layout>
-- <longname>Spanish</longname>
-- <description>Spanish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:es:cat:cat</name>
-- <language>cat</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>es</layout>
-- <layout_variant>cat</layout_variant>
-- <longname>Catalan (Spain, with middle-dot L)</longname>
-- <description>Catalan (Spain, with middle-dot L)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:se::swe</name>
-- <language>swe</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>se</layout>
-- <longname>Swedish</longname>
-- <description>Swedish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:se:dvorak:swe</name>
-- <language>swe</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>se</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>Swedish (Dvorak)</longname>
-- <description>Swedish (Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ch::ger</name>
-- <language>ger</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ch</layout>
-- <longname>German (Switzerland)</longname>
-- <description>German (Switzerland)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ch:fr:fra</name>
-- <language>fra</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ch</layout>
-- <layout_variant>fr</layout_variant>
-- <longname>French (Switzerland)</longname>
-- <description>French (Switzerland)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:tr::tur</name>
-- <language>tur</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>tr</layout>
-- <longname>Turkish</longname>
-- <description>Turkish</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:ua::ukr</name>
-- <language>ukr</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ua</layout>
-- <longname>Ukrainian</longname>
-- <description>Ukrainian</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:gb:extd:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb</layout>
-- <layout_variant>extd</layout_variant>
-- <longname>English (UK, extended WinKeys)</longname>
-- <description>English (UK, extended WinKeys)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:gb:dvorak:eng</name>
-- <language>eng</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>English (UK, Dvorak)</longname>
-- <description>English (UK, Dvorak)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:kr:kr104:kor</name>
-- <language>kor</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>kr</layout>
-- <layout_variant>kr104</layout_variant>
-- <longname>Korean (101/104 key compatible)</longname>
-- <description>Korean (101/104 key compatible)</description>
-- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- </engines>
-+ <engines exec=\"${libexecdir}/ibus-engine-simple --xml\" />
- </component>
+ <key>/schemas/desktop/ibus/general/hotkey/enable_unconditional</key>
+ <applyto>/desktop/ibus/general/hotkey/enable_unconditional</applyto>
+ <owner>ibus</owner>
diff --git a/ibus-1.0.pc.in b/ibus-1.0.pc.in
-index 9f593ab..66b902a 100644
+index 9f593ab..c93a0ed 100644
--- a/ibus-1.0.pc.in
+++ b/ibus-1.0.pc.in
-@@ -1,9 +1,13 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- libdir=@libdir@
-+libexecdir=@libexecdir@
+@@ -4,6 +4,7 @@ libdir=@libdir@
includedir=@includedir@
datadir=@datadir@
pkgdatadir=@datadir@/ibus
-+have_ibus_xkb=@HAVE_IBUS_XKB@
-+ibus_xkb=${libexecdir}/ibus-xkb
+have_ibus_gkbd=@HAVE_IBUS_GKBD@
Name: IBus
@@ -1739,91 +274,16 @@ index 58cac38..4b6f869 100644
%configure $OPTIONS
# make -C po update-gmo
-diff --git a/setup/main.py b/setup/main.py
-index f527da1..c02229b 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -67,6 +67,13 @@ class Setup(object):
- def __init__(self):
- super(Setup, self).__init__()
-
-+ # In the latest pygobject3 3.3.4 or later, g_variant_dup_strv
-+ # returns the allocated strv but in the previous release,
-+ # it returned the tuple of (strv, length)
-+ self.__tuple_for_variant_strv = False
-+ if type(GLib.Variant.new_strv([]).dup_strv()) == tuple:
-+ self.__tuple_for_variant_strv = True
-+
- # IBus.Bus() calls ibus_bus_new().
- # Gtk.Builder().add_from_file() also calls ibus_bus_new_async()
- # via ibus_im_context_new().
-@@ -191,14 +198,22 @@ class Setup(object):
-
- # init engine page
- self.__engines = self.__bus.list_engines()
-+ value = self.__config.get_value("general", "load_xkb_layouts")
-+ load_layouts = []
-+ if value != None:
-+ load_layouts = self.__variant_dup_strv(value)
-+ engines = []
-+ for engine in self.__engines:
-+ if not engine.get_name().startswith('xkb:'):
-+ engines.append(engine)
-+ elif engine.get_layout() in load_layouts:
-+ engines.append(engine)
-+
- self.__combobox = self.__builder.get_object("combobox_engines")
-- self.__combobox.set_engines(self.__engines)
-+ self.__combobox.set_engines(engines)
-
-- tmp_dict = {}
-- for e in self.__engines:
-- tmp_dict[e.get_name()] = e
- engine_names = values.get("preload_engines", [])
-- engines = [tmp_dict[name] for name in engine_names if name in tmp_dict]
-+ engines = self.__get_engine_descs_from_names(engine_names)
-
- self.__treeview = self.__builder.get_object("treeview_engines")
- self.__treeview.set_engines(engines)
-@@ -247,6 +262,12 @@ class Setup(object):
- self.__init_panel()
- self.__init_general()
-
-+ def __variant_dup_strv(self, variant):
-+ if self.__tuple_for_variant_strv:
-+ return variant.dup_strv()[0]
-+ else:
-+ return variant.dup_strv()
-+
- def __combobox_notify_active_engine_cb(self, combobox, property):
- engine = self.__combobox.get_active_engine()
- button = self.__builder.get_object("button_engine_add")
-@@ -271,6 +292,13 @@ class Setup(object):
- args.append(path.basename(setup_path))
- return args
-
-+ def __get_engine_descs_from_names(self, engine_names):
-+ tmp_dict = {}
-+ for e in self.__engines:
-+ tmp_dict[e.get_name()] = e
-+ engines = [tmp_dict[name] for name in engine_names if name in tmp_dict]
-+ return engines
-+
- def __treeview_notify_cb(self, treeview, prop):
- if prop.name not in ("active-engine", "engines"):
- return
diff --git a/src/Makefile.am b/src/Makefile.am
-index df4ada3..f8499a8 100644
+index 7ee5df8..8fa954e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -194,6 +194,11 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+@@ -197,6 +197,9 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
endif
-+if ENABLE_IBUS_XKB
+ibus_sources += ibusxkbxml.c
+ibus_headers += ibusxkbxml.h
-+endif
+
# gen enum types
ibusenumtypes.h: $(ibus_headers) ibusenumtypes.h.template
@@ -2506,7 +966,7 @@ index 0000000..6f5b7bd
+G_END_DECLS
+#endif
diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index 5473027..6cb02a1 100644
+index 5473027..b7e663c 100644
--- a/ui/gtk3/Makefile.am
+++ b/ui/gtk3/Makefile.am
@@ -47,6 +47,8 @@ USE_SYMBOL_ICON = FALSE
@@ -2518,17 +978,16 @@ index 5473027..6cb02a1 100644
AM_CFLAGS = \
@GLIB2_CFLAGS@ \
@GIO2_CFLAGS@ \
-@@ -58,6 +60,9 @@ AM_CFLAGS = \
+@@ -58,6 +60,8 @@ AM_CFLAGS = \
-DBINDIR=\"$(bindir)\" \
-DIBUS_DISABLE_DEPRECATED \
-DSWITCHER_USE_SYMBOL_ICON=$(USE_SYMBOL_ICON) \
+ -DHAVE_IBUS_GKBD=$(HAVE_IBUS_GKBD_C) \
-+ -DIBUS_XKB_COMMAND=\"$(libexecdir)/ibus-xkb\" \
+ -DXKB_LAYOUTS_MAX_LENGTH=4 \
-Wno-unused-variable \
-Wno-unused-but-set-variable \
-Wno-unused-function \
-@@ -91,6 +96,7 @@ ibus_ui_gtk3_SOURCES = \
+@@ -91,6 +95,7 @@ ibus_ui_gtk3_SOURCES = \
application.vala \
candidatearea.vala \
candidatepanel.vala \
@@ -2536,7 +995,7 @@ index 5473027..6cb02a1 100644
handle.vala \
iconwidget.vala \
keybindingmanager.vala \
-@@ -99,17 +105,48 @@ ibus_ui_gtk3_SOURCES = \
+@@ -99,17 +104,48 @@ ibus_ui_gtk3_SOURCES = \
property.vala \
separator.vala \
switcher.vala \
@@ -2769,31 +1228,10 @@ index 0000000..2b78c69
+ */
+}
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index c159693..63b0cde 100644
+index 24e6b2e..55b63ce 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
-@@ -21,6 +21,20 @@
- */
-
- class Panel : IBus.PanelService {
-+ private class Keybinding {
-+ public Keybinding(uint keysym,
-+ Gdk.ModifierType modifiers,
-+ bool reverse) {
-+ this.keysym = keysym;
-+ this.modifiers = modifiers;
-+ this.reverse = reverse;
-+ }
-+
-+ public uint keysym { get; set; }
-+ public Gdk.ModifierType modifiers { get; set; }
-+ public bool reverse { get; set; }
-+ }
-+
- private IBus.Bus m_bus;
- private IBus.Config m_config;
- private Gtk.StatusIcon m_status_icon;
-@@ -34,10 +48,17 @@ class Panel : IBus.PanelService {
+@@ -48,6 +48,13 @@ class Panel : IBus.PanelService {
private Gtk.AboutDialog m_about_dialog;
private Gtk.CssProvider m_css_provider;
private int m_switcher_delay_time = 400;
@@ -2805,25 +1243,9 @@ index c159693..63b0cde 100644
+ private bool m_changed_xkb_option = false;
+ private GLib.Timer m_changed_layout_timer;
private const string ACCELERATOR_SWITCH_IME_FOREWARD = "<Control>space";
-+ private const string ACCELERATOR_SWITCH_IME_BACKWARD = "<Control><Shift>space";
-- private uint m_switch_keysym = 0;
-- private Gdk.ModifierType m_switch_modifiers = 0;
-+ private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
-
- public Panel(IBus.Bus bus) {
- GLib.assert(bus.is_connected());
-@@ -60,7 +81,8 @@ class Panel : IBus.PanelService {
- m_candidate_panel.page_down.connect((w) => this.page_down());
-
- m_switcher = new Switcher();
-- bind_switch_shortcut();
-+ // The initial shortcut is "<Control>space"
-+ bind_switch_shortcut(null);
-
- if (m_switcher_delay_time >= 0) {
- m_switcher.set_popup_delay_time((uint) m_switcher_delay_time);
-@@ -76,64 +98,132 @@ class Panel : IBus.PanelService {
+ private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
+@@ -90,6 +97,14 @@ class Panel : IBus.PanelService {
~Panel() {
unbind_switch_shortcut();
@@ -2837,166 +1259,17 @@ index c159693..63b0cde 100644
+ m_xkblayout = null;
}
-- private void bind_switch_shortcut() {
-- var keybinding_manager = KeybindingManager.get_instance();
-+ private void keybinding_manager_bind(KeybindingManager keybinding_manager,
-+ string? accelerator) {
-+ uint switch_keysym = 0;
-+ Gdk.ModifierType switch_modifiers = 0;
-+ Gdk.ModifierType reverse_modifier = Gdk.ModifierType.SHIFT_MASK;
-+ Keybinding keybinding;
-
-- var accelerator = ACCELERATOR_SWITCH_IME_FOREWARD;
- Gtk.accelerator_parse(accelerator,
-- out m_switch_keysym, out m_switch_modifiers);
-+ out switch_keysym, out switch_modifiers);
-
-- // Map virtual modifiers to (i.e.Mod2, Mod3, ...)
-+ // Map virtual modifiers to (i.e. Mod2, Mod3, ...)
- const Gdk.ModifierType VIRTUAL_MODIFIERS = (
- Gdk.ModifierType.SUPER_MASK |
- Gdk.ModifierType.HYPER_MASK |
- Gdk.ModifierType.META_MASK);
-- if ((m_switch_modifiers & VIRTUAL_MODIFIERS) != 0) {
-+ if ((switch_modifiers & VIRTUAL_MODIFIERS) != 0) {
- // workaround a bug in gdk vapi vala > 0.18
- // https://bugzilla.gnome.org/show_bug.cgi?id=677559
- #if VALA_0_18
- Gdk.Keymap.get_default().map_virtual_modifiers(
-- ref m_switch_modifiers);
-+ ref switch_modifiers);
- #else
-- if ((m_switch_modifiers & Gdk.ModifierType.SUPER_MASK) != 0)
-- m_switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
-- if ((m_switch_modifiers & Gdk.ModifierType.HYPER_MASK) != 0)
-- m_switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
-+ if ((switch_modifiers & Gdk.ModifierType.SUPER_MASK) != 0)
-+ switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
-+ if ((switch_modifiers & Gdk.ModifierType.HYPER_MASK) != 0)
-+ switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
- #endif
-- m_switch_modifiers &= ~VIRTUAL_MODIFIERS;
-+ switch_modifiers &= ~VIRTUAL_MODIFIERS;
- }
-
-- if (m_switch_keysym == 0 && m_switch_modifiers == 0) {
-+ if (switch_keysym == 0 && switch_modifiers == 0) {
- warning("Parse accelerator '%s' failed!", accelerator);
- return;
- }
-
-- keybinding_manager.bind(m_switch_keysym, m_switch_modifiers,
-+ keybinding = new Keybinding(switch_keysym,
-+ switch_modifiers,
-+ false);
-+ m_keybindings.append(keybinding);
-+
-+ keybinding_manager.bind(switch_keysym, switch_modifiers,
- (e) => handle_engine_switch(e, false));
-
- // accelerator already has Shift mask
-- if ((m_switch_modifiers & Gdk.ModifierType.SHIFT_MASK) != 0)
-+ if ((switch_modifiers & reverse_modifier) != 0) {
- return;
-+ }
-
-- keybinding_manager.bind(m_switch_keysym,
-- m_switch_modifiers | Gdk.ModifierType.SHIFT_MASK,
-+ switch_modifiers |= reverse_modifier;
-+ keybinding = new Keybinding(switch_keysym,
-+ switch_modifiers,
-+ true);
-+ m_keybindings.append(keybinding);
-+
-+ keybinding_manager.bind(switch_keysym, switch_modifiers,
- (e) => handle_engine_switch(e, true));
-+
-+ }
-+
-+ // ToDo: Customize the input method with ibus-setup
-+ private void bind_switch_shortcut(Variant ?variant) {
-+ string locale = GLib.Intl.setlocale(GLib.LocaleCategory.ALL,
-+ null);
-+ if (locale == null) {
-+ locale = "C";
-+ }
-+
-+ string[] accelerators = {};
-+ Variant var_trigger = variant;
-+
-+ if (var_trigger == null && m_config != null) {
-+ var_trigger = m_config.get_value("general/hotkey",
-+ "trigger_accel");
-+ }
-+
-+ if (var_trigger != null) {
-+ accelerators = var_trigger.dup_strv();
-+ } else {
-+ accelerators += ACCELERATOR_SWITCH_IME_FOREWARD;
-+ }
-+
-+ if (accelerators.length == 1 &&
-+ accelerators[0] == ACCELERATOR_SWITCH_IME_FOREWARD) {
-+ // FIXME: When us keyboard is used, Zenkaku_Hankaku does not work.
-+ /*
-+ if (locale[0:2] == "ja") {
-+ accelerators += "Zenkaku_Hankaku";
-+ }
-+ */
-+ if (locale[0:2] == "ko") {
-+ accelerators += "Hangul";
-+ accelerators += "Alt_R";
-+ }
-+ }
-+
-+ var keybinding_manager = KeybindingManager.get_instance();
-+
-+ foreach (var accelerator in accelerators) {
-+ keybinding_manager_bind(keybinding_manager, accelerator);
-+ }
- }
-
- private void unbind_switch_shortcut() {
- var keybinding_manager = KeybindingManager.get_instance();
-
-- if (m_switch_keysym == 0 && m_switch_modifiers == 0)
-- return;
-+ unowned GLib.List<Keybinding> keybindings = m_keybindings;
-+
-+ while (keybindings != null) {
-+ Keybinding keybinding = keybindings.data;
-
-- keybinding_manager.unbind(m_switch_keysym, m_switch_modifiers);
-- keybinding_manager.unbind(m_switch_keysym,
-- m_switch_modifiers | Gdk.ModifierType.SHIFT_MASK);
-+ keybinding_manager.unbind(keybinding.keysym,
-+ keybinding.modifiers);
-+ keybindings = keybindings.next;
-+ }
-
-- m_switch_keysym = 0;
-- m_switch_modifiers = 0;
-+ m_keybindings = null;
- }
-
- private void set_custom_font() {
-@@ -225,10 +315,14 @@ class Panel : IBus.PanelService {
- m_config.watch("general", "preload_engines");
- m_config.watch("general", "engines_order");
- m_config.watch("general", "switcher_delay_time");
-+ m_config.watch("general/hotkey", "trigger_accel");
+ private void keybinding_manager_bind(KeybindingManager keybinding_manager,
+@@ -281,6 +296,7 @@ class Panel : IBus.PanelService {
+ m_config.watch("general/hotkey", "triggers");
m_config.watch("panel", "custom_font");
m_config.watch("panel", "use_custom_font");
+ init_engines_order();
update_engines(m_config.get_value("general", "preload_engines"),
m_config.get_value("general", "engines_order"));
-+ unbind_switch_shortcut();
-+ bind_switch_shortcut(null);
- set_switcher_delay_time(null);
- } else {
- update_engines(null, null);
-@@ -282,6 +376,200 @@ class Panel : IBus.PanelService {
- }
+ unbind_switch_shortcut();
+@@ -293,6 +309,204 @@ class Panel : IBus.PanelService {
+ set_custom_font();
}
+ private void gkbdlayout_changed_cb() {
@@ -3090,7 +1363,7 @@ index c159693..63b0cde 100644
+ var_xkb_engine_names += "%s:%s:%s".printf("xkb", name, lang);
+ }
+
-+ GLib.Variant var_engines =
++ GLib.Variant var_engines =
+ m_config.get_value("general", "preload_engines");
+ string[] engine_names = {};
+ bool updated_engine_names = false;
@@ -3135,11 +1408,8 @@ index c159693..63b0cde 100644
+ }
+ }
+
-+ private void set_xkb_group_layout(string layout) {
-+ int[] retval = m_xkblayout.set_layout(layout,
-+ "default",
-+ "default",
-+ true);
++ private void set_xkb_group_layout(IBus.EngineDesc engine) {
++ int[] retval = m_xkblayout.set_layout(engine, true);
+ if (retval[0] >= 0) {
+ /* If an XKB keymap is added into the XKB group,
+ * this._gkbdlayout.lock_group will be called after
@@ -3149,7 +1419,10 @@ index c159693..63b0cde 100644
+ }
+ }
+
-+ private bool set_gkbd_layout(string layout) {
++ private bool set_gkbd_layout(IBus.EngineDesc engine) {
++ string layout = engine.get_layout();
++ string variant = engine.get_layout_variant();
++
+ /* If a previous ibus engine changed XKB options, need to set the
+ * default XKB option. */
+ if (m_changed_xkb_option == true) {
@@ -3157,6 +1430,10 @@ index c159693..63b0cde 100644
+ return false;
+ }
+
++ if (variant != "" && variant != "default") {
++ layout = "%s(%s)".printf(layout, variant);
++ }
++
+ int gkbd_len = m_gkbdlayout.get_group_names().length;
+ for (int i = 0; i < m_layouts.length && i < gkbd_len; i++) {
+ string sys_layout = m_layouts[i];
@@ -3174,7 +1451,7 @@ index c159693..63b0cde 100644
+ private void set_layout(IBus.EngineDesc engine) {
+ string layout = engine.get_layout();
+
-+ if (layout == "default" || layout == null) {
++ if (layout == "" || layout == null) {
+ return;
+ }
+
@@ -3183,20 +1460,20 @@ index c159693..63b0cde 100644
+ }
+
+ if (HAVE_IBUS_GKBD && m_gkbdlayout != null) {
-+ if (set_gkbd_layout(layout)) {
++ if (set_gkbd_layout(engine)) {
+ return;
+ }
-+ set_xkb_group_layout(layout);
++ set_xkb_group_layout(engine);
+ return;
+ }
+
-+ m_xkblayout.set_layout(layout);
++ m_xkblayout.set_layout(engine);
+ }
+
- private void switch_engine(int i, bool force = false) {
- GLib.assert(i >= 0 && i < m_engines.length);
-
-@@ -296,7 +584,7 @@ class Panel : IBus.PanelService {
+ private void exec_setxkbmap(IBus.EngineDesc engine) {
+ string layout = engine.get_layout();
+ string variant = engine.get_layout_variant();
+@@ -352,7 +566,7 @@ class Panel : IBus.PanelService {
return;
}
// set xkb layout
@@ -3205,58 +1482,12 @@ index c159693..63b0cde 100644
}
private void config_value_changed_cb(IBus.Config config,
-@@ -308,6 +596,12 @@ class Panel : IBus.PanelService {
- return;
- }
-
-+ if (section == "general/hotkey" && name == "trigger_accel") {
-+ unbind_switch_shortcut();
-+ bind_switch_shortcut(variant);
-+ return;
-+ }
-+
- if (section == "panel" && (name == "custom_font" ||
- name == "use_custom_font")) {
- set_custom_font();
-@@ -316,6 +610,7 @@ class Panel : IBus.PanelService {
-
- if (section == "general" && name == "switcher_delay_time") {
- set_switcher_delay_time(variant);
-+ return;
- }
- }
-
-@@ -324,15 +619,22 @@ class Panel : IBus.PanelService {
- if (m_engines.length <= 1)
- return;
-
-+ uint keyval = event.key.keyval;
-+ uint modifiers = KeybindingManager.MODIFIER_FILTER & event.key.state;
-+
- uint primary_modifiers =
- KeybindingManager.get_primary_modifier(event.key.state);
-
- bool pressed = KeybindingManager.primary_modifier_still_pressed(
- event, primary_modifiers);
-+
-+ if (revert) {
-+ modifiers &= ~Gdk.ModifierType.SHIFT_MASK;
-+ }
-+
- if (pressed && m_switcher_delay_time >= 0) {
- int i = revert ? m_engines.length - 1 : 1;
-- i = m_switcher.run(m_switch_keysym, m_switch_modifiers, event,
-- m_engines, i);
-+ i = m_switcher.run(keyval, modifiers, event, m_engines, i);
- if (i < 0) {
- debug("switch cancelled");
- } else {
diff --git a/ui/gtk3/xkblayout.vala b/ui/gtk3/xkblayout.vala
new file mode 100644
-index 0000000..2092a60
+index 0000000..165a905
--- /dev/null
+++ b/ui/gtk3/xkblayout.vala
-@@ -0,0 +1,465 @@
+@@ -0,0 +1,431 @@
+/* vim:set et sts=4 sw=4:
+ *
+ * ibus - The Input Bus
@@ -3282,13 +1513,11 @@ index 0000000..2092a60
+ */
+
+public extern const bool HAVE_IBUS_GKBD;
-+public extern const bool HAVE_IBUS_XKB;
+public extern const int XKB_LAYOUTS_MAX_LENGTH;
-+public extern const string IBUS_XKB_COMMAND;
+
+class XKBLayout
+{
-+ string m_xkb_command = IBUS_XKB_COMMAND;
++ string m_xkb_command = "setxkbmap";
+ IBus.Config m_config = null;
+ string[] m_xkb_latin_layouts = {};
+ GLib.Pid m_xkb_pid = -1;
@@ -3302,10 +1531,6 @@ index 0000000..2092a60
+ string m_default_option = "";
+
+ public XKBLayout(IBus.Config? config) {
-+ if (!HAVE_IBUS_XKB) {
-+ m_xkb_command = "setxkbmap";
-+ }
-+
+ m_config = config;
+
+ if (config != null) {
@@ -3350,6 +1575,11 @@ index 0000000..2092a60
+ if (element.length <= line.length &&
+ line[0:element.length] == element) {
+ retval = line[element.length:line.length];
++ if (retval == null) {
++ retval = "";
++ } else {
++ retval = retval.strip();
++ }
+ }
+ }
+ return retval;
@@ -3476,27 +1706,15 @@ index 0000000..2092a60
+ }
+
+ public string get_layout() {
-+ if (HAVE_IBUS_XKB) {
-+ return get_output_from_cmdline("--get", "layout: ");
-+ } else {
-+ return get_output_from_cmdline("-query", "layout: ");
-+ }
++ return get_output_from_cmdline("-query", "layout: ");
+ }
+
+ public string get_variant() {
-+ if (HAVE_IBUS_XKB) {
-+ return get_output_from_cmdline("--get", "variant: ");
-+ } else {
-+ return get_output_from_cmdline("-query", "variant: ");
-+ }
++ return get_output_from_cmdline("-query", "variant: ");
+ }
+
+ public string get_option() {
-+ if (HAVE_IBUS_XKB) {
-+ return get_output_from_cmdline("--get", "option: ");
-+ } else {
-+ return get_output_from_cmdline("-query", "options: ");
-+ }
++ return get_output_from_cmdline("-query", "options: ");
+ }
+
+ /*
@@ -3505,11 +1723,13 @@ index 0000000..2092a60
+ }
+ */
+
-+ public int[] set_layout(string _layout="default",
-+ string _variant="default",
-+ string _option="default",
-+ bool use_group_layout=false) {
-+ assert (_layout != null);
++ public int[] set_layout(IBus.EngineDesc engine,
++ bool use_group_layout=false) {
++ string layout = engine.get_layout();
++ string variant = engine.get_layout_variant();
++ string option = engine.get_layout_option();
++
++ assert (layout != null);
+
+ int xkb_group_id = 0;
+ int changed_option = 0;
@@ -3518,26 +1738,11 @@ index 0000000..2092a60
+ return {-1, 0};
+ }
+
-+ if (_layout == "default" && _variant == "default" &&
-+ _option == "default") {
++ if (layout == "default" &&
++ (variant == "default" || variant == "") &&
++ (option == "default" || option == "")) {
+ return {-1, 0};
+ }
-+ // const gchar to gchar
-+ string layout = _layout;
-+ string variant = _variant;
-+ string option = _option;
-+
-+ if (variant == "default") {
-+ string[] array = get_variant_from_layout(layout);
-+ layout = array[0];
-+ variant = array[1];
-+ }
-+
-+ if (option == "default") {
-+ string[] array = get_option_from_layout(layout);
-+ layout = array[0];
-+ option = array[1];
-+ }
+
+ bool need_us_layout = false;
+ foreach (string latin_layout in m_xkb_latin_layouts) {
@@ -3616,25 +1821,17 @@ index 0000000..2092a60
+
+ string[] args = {};
+ args += m_xkb_command;
-+ if (HAVE_IBUS_XKB) {
-+ args += "--layout";
-+ args += layout;
-+ if (variant != null) {
-+ args += "--variant";
-+ args += variant;
-+ }
-+ if (option != null) {
-+ args += "--option";
-+ args += option;
-+ }
-+ } else {
-+ args += layout;
-+ if (variant != null) {
-+ args += variant;
-+ }
-+ if (option != null) {
-+ args += option;
-+ }
++ args += "-layout";
++ args += layout;
++ if (variant != null) {
++ args += "-variant";
++ args += variant;
++ }
++ if (option != null) {
++ /* TODO: Need to get the session XKB options */
++ args += "-option";
++ args += "-option";
++ args += option;
+ }
+
+ GLib.Pid child_pid;
@@ -3647,7 +1844,7 @@ index 0000000..2092a60
+ null,
+ out child_pid);
+ } catch (GLib.SpawnError err) {
-+ stderr.printf("IBUS_ERROR: %s\n", err.message);
++ stderr.printf("Execute setxkbmap failed: %s\n", err.message);
+ return {-1, 0};
+ }
+ m_xkb_pid = child_pid;
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index a48ab7b..00c3b85 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -1,323 +1,397 @@
-From 15f3ccb38474c6bb206a2158d86171c93d6ec6a5 Mon Sep 17 00:00:00 2001
+From 8ac534fc002356b93e2015a8866f1ea89e3895f9 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 13 Nov 2012 12:05:07 +0900
-Subject: [PATCH] Update simple.xml to enable layout_variant tag.
+Date: Sat, 15 Dec 2012 17:40:18 +0900
+Subject: [PATCH] Use Variant.unpack() instead of Variant.dup_strv().
-Review URL: https://codereview.appspot.com/6820129
+Variant.dup_strv() returns a tuple in pygobject 3.2, e.g. (['<Control>space'], 1L), and a list in pygobject 3.4, e.g. ['<Control>space'] .
+
+BUG=RH#887153
+
+Review URL: https://codereview.appspot.com/6941051
---
- engine/simple.xml.in.in | 112 ++++++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 93 insertions(+), 19 deletions(-)
+ setup/main.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/engine/simple.xml.in.in b/engine/simple.xml.in.in
-index 25db578..d064ad6 100644
---- a/engine/simple.xml.in.in
-+++ b/engine/simple.xml.in.in
-@@ -24,7 +24,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us(intl)</layout>
-+ <layout>us</layout>
-+ <layout_variant>intl</layout_variant>
- <longname>English (US, international with dead keys)</longname>
- <description>English (US, international with dead keys)</description>
- <icon>ibus-keyboard</icon>
-@@ -35,7 +36,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us(colemak)</layout>
-+ <layout>us</layout>
-+ <layout_variant>colemak</layout_variant>
- <longname>English (Colemak)</longname>
- <description>English (Colemak)</description>
- <icon>ibus-keyboard</icon>
-@@ -46,7 +48,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us(dvorak)</layout>
-+ <layout>us</layout>
-+ <layout_variant>dvorak</layout_variant>
- <longname>English (Dvorak)</longname>
- <description>English (Dvorak)</description>
- <icon>ibus-keyboard</icon>
-@@ -57,20 +60,21 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us(altgr-intl)</layout>
-+ <layout>us</layout>
-+ <layout_variant>altgr-intl</layout_variant>
- <longname>English (international AltGr dead keys)</longname>
- <description>English (international AltGr dead keys)</description>
- <icon>ibus-keyboard</icon>
- <rank>99</rank>
- </engine>
- <engine>
-- <name>xkb:us:altgr-intl:eng</name>
-- <language>eng</language>
-+ <name>xkb:ara::ara</name>
-+ <language>ara</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>us(altgr-intl)</layout>
-- <longname>English (international AltGr dead keys)</longname>
-- <description>English (international AltGr dead keys)</description>
-+ <layout>ara</layout>
-+ <longname>Arabic</longname>
-+ <description>Arabic</description>
- <icon>ibus-keyboard</icon>
- <rank>99</rank>
- </engine>
-@@ -119,6 +123,18 @@
- <rank>99</rank>
- </engine>
- <engine>
-+ <name>xkb:br:dvorak:por</name>
-+ <language>por</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>br</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>Portuguese (Brazil, Dvorak)</longname>
-+ <description>Portuguese (Brazil, Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
- <name>xkb:bg::bul</name>
- <language>bul</language>
- <license>GPL</license>
-@@ -134,7 +150,8 @@
- <language>bul</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>bg(phonetic)</layout>
-+ <layout>bg</layout>
-+ <layout_variant>phonetic</layout_variant>
- <longname>Bulgarian (traditional phonetic)</longname>
- <description>Bulgarian (traditional phonetic)</description>
- <icon>ibus-keyboard</icon>
-@@ -156,7 +173,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ca(eng)</layout>
-+ <layout>ca</layout>
-+ <layout_variant>eng</layout_variant>
- <longname>English (Canada)</longname>
- <description>English (Canada)</description>
- <icon>ibus-keyboard</icon>
-@@ -229,6 +247,18 @@
- <rank>99</rank>
- </engine>
- <engine>
-+ <name>xkb:fr:dvorak:fra</name>
-+ <language>fra</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>fr</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>French (Dvorak)</longname>
-+ <description>French (Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
- <name>xkb:de::ger</name>
- <language>ger</language>
- <license>GPL</license>
-@@ -240,11 +270,24 @@
- <rank>99</rank>
- </engine>
- <engine>
-+ <name>xkb:de:dvorak:ger</name>
-+ <language>ger</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>de</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>German (Dvorak)</longname>
-+ <description>German (Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
- <name>xkb:de:neo:ger</name>
- <language>ger</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>de(neo)</layout>
-+ <layout>de</layout>
-+ <layout_variant>neo</layout_variant>
- <longname>German (Neo 2)</longname>
- <description>German (Neo 2)</description>
- <icon>ibus-keyboard</icon>
-@@ -332,7 +375,8 @@
- <language>lav</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>lv(apostrophe)</layout>
-+ <layout>lv</layout>
-+ <layout_variant>apostrophe</layout_variant>
- <longname>Latvian (apostrophe variant)</longname>
- <description>Latvian (apostrophe variant)</description>
- <icon>ibus-keyboard</icon>
-@@ -350,6 +394,18 @@
- <rank>99</rank>
- </engine>
- <engine>
-+ <name>xkb:pl:dvorak:pol</name>
-+ <language>pol</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>pl</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>Polish (Dvorak)</longname>
-+ <description>Polish (Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
- <name>xkb:pt::por</name>
- <language>por</language>
- <license>GPL</license>
-@@ -387,7 +443,8 @@
- <language>rus</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ru(phonetic)</layout>
-+ <layout>ru</layout>
-+ <layout_variant>phonetic</layout_variant>
- <longname>Russian (phonetic)</longname>
- <description>Russian (phonetic)</description>
- <icon>ibus-keyboard</icon>
-@@ -442,7 +499,8 @@
- <language>cat</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>es(cat)</layout>
-+ <layout>es</layout>
-+ <layout_variant>cat</layout_variant>
- <longname>Catalan (Spain, with middle-dot L)</longname>
- <description>Catalan (Spain, with middle-dot L)</description>
- <icon>ibus-keyboard</icon>
-@@ -460,6 +518,18 @@
- <rank>99</rank>
- </engine>
- <engine>
-+ <name>xkb:se:dvorak:swe</name>
-+ <language>swe</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>se</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>Swedish (Dvorak)</longname>
-+ <description>Swedish (Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
- <name>xkb:ch::ger</name>
- <language>ger</language>
- <license>GPL</license>
-@@ -475,7 +545,8 @@
- <language>fra</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>ch(fr)</layout>
-+ <layout>ch</layout>
-+ <layout_variant>fr</layout_variant>
- <longname>French (Switzerland)</longname>
- <description>French (Switzerland)</description>
- <icon>ibus-keyboard</icon>
-@@ -508,7 +579,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb(extd)</layout>
-+ <layout>gb</layout>
-+ <layout_variant>extd</layout_variant>
- <longname>English (UK, extended WinKeys)</longname>
- <description>English (UK, extended WinKeys)</description>
- <icon>ibus-keyboard</icon>
-@@ -519,7 +591,8 @@
- <language>eng</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb(dvorak)</layout>
-+ <layout>gb</layout>
-+ <layout_variant>dvorak</layout_variant>
- <longname>English (UK, Dvorak)</longname>
- <description>English (UK, Dvorak)</description>
- <icon>ibus-keyboard</icon>
-@@ -530,7 +603,8 @@
- <language>kor</language>
- <license>GPL</license>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>kr(kr104)</layout>
-+ <layout>kr</layout>
-+ <layout_variant>kr104</layout_variant>
- <longname>Korean (101/104 key compatible)</longname>
- <description>Korean (101/104 key compatible)</description>
- <icon>ibus-keyboard</icon>
+diff --git a/setup/main.py b/setup/main.py
+index a8acc7a..707faa4 100644
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -87,7 +87,7 @@ class Setup(object):
+ label = 'switch_engine'
+ variant = self.__config.get_value('general/hotkey', name)
+ if variant != None:
+- shortcuts = variant.dup_strv()
++ shortcuts = variant.unpack()
+ else:
+ shortcuts = ['<Control>space']
+
--
-1.8.0
+1.7.12.1
-From ae98b5a58846e1326550027dc8d2a773ed8a24c5 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 30 Nov 2012 11:43:43 +0900
-Subject: [PATCH] Fix xmllint errors.
+From 62cd0492e3459416e1775aedc327bced53f66828 Mon Sep 17 00:00:00 2001
+From: Rui Matos <tiagomatos@gmail.com>
+Date: Wed, 9 Jan 2013 10:14:55 -0500
+Subject: [PATCH] client: Queue events while the IBus context isn't ready
+
+There are actually 3 patches here.
+
+---
+client: Queue events while the IBus context isn't ready
+
+We may lose events that ought to be processed while the IBus context
+isn't ready or if the connection to IBus isn't fully established yet.
+
+To avoid that, enqueue events to be processed later when the IBus
+context creation finishes.
+
+---
+client: Don't cancel an ongoing create input context on another request
+
+This would only add more delays.
+
+---
+client: Cancel any ongoing create input context request on finalize
+
+BUG=
-Review URL: https://codereview.appspot.com/6842115
+Review URL: https://codereview.appspot.com/6988047
+Patch from Rui Matos <tiagomatos@gmail.com>.
---
- conf/dconf/dconf.xml.in.in | 2 +-
- conf/gconf/gconf.xml.in.in | 2 +-
- conf/memconf/memconf.xml.in.in | 2 +-
- ui/gtk3/gtkpanel.xml.in.in | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
+ client/gtk2/ibusimcontext.c | 220 ++++++++++++++++++++++++++------------------
+ 1 file changed, 133 insertions(+), 87 deletions(-)
-diff --git a/conf/dconf/dconf.xml.in.in b/conf/dconf/dconf.xml.in.in
-index 0367008..ceb2b0c 100644
---- a/conf/dconf/dconf.xml.in.in
-+++ b/conf/dconf/dconf.xml.in.in
-@@ -1,4 +1,4 @@
--<?xml version="1.0" encoding="utf-8"?>
-+<?xml version=\"1.0\" encoding=\"utf-8\"?>
- <!-- filename: dconf.xml -->
- <component>
- <name>org.freedesktop.IBus.Config</name>
-diff --git a/conf/gconf/gconf.xml.in.in b/conf/gconf/gconf.xml.in.in
-index 0644d7e..d82179f 100644
---- a/conf/gconf/gconf.xml.in.in
-+++ b/conf/gconf/gconf.xml.in.in
-@@ -1,4 +1,4 @@
--<?xml version="1.0" encoding="utf-8"?>
-+<?xml version=\"1.0\" encoding=\"utf-8\"?>
- <!-- filename: pinyin.xml -->
- <component>
- <name>org.freedesktop.IBus.Config</name>
-diff --git a/conf/memconf/memconf.xml.in.in b/conf/memconf/memconf.xml.in.in
-index b60dbf2..939e40a 100644
---- a/conf/memconf/memconf.xml.in.in
-+++ b/conf/memconf/memconf.xml.in.in
-@@ -1,4 +1,4 @@
--<?xml version="1.0" encoding="utf-8"?>
-+<?xml version=\"1.0\" encoding=\"utf-8\"?>
- <component>
- <name>org.freedesktop.IBus.Config</name>
- <description>On-memory Config Component</description>
-diff --git a/ui/gtk3/gtkpanel.xml.in.in b/ui/gtk3/gtkpanel.xml.in.in
-index c480bcd..1d2cf73 100644
---- a/ui/gtk3/gtkpanel.xml.in.in
-+++ b/ui/gtk3/gtkpanel.xml.in.in
-@@ -1,4 +1,4 @@
--<?xml version="1.0" encoding="utf-8"?>
-+<?xml version=\"1.0\" encoding=\"utf-8\"?>
- <!-- filename: gtkpanel.xml -->
- <component>
- <name>org.freedesktop.IBus.Panel</name>
+diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
+index 011676f..94005b7 100644
+--- a/client/gtk2/ibusimcontext.c
++++ b/client/gtk2/ibusimcontext.c
+@@ -40,6 +40,8 @@
+ # define IDEBUG(a...)
+ #endif
+
++#define MAX_QUEUED_EVENTS 20
++
+ struct _IBusIMContext {
+ GtkIMContext parent;
+
+@@ -63,6 +65,7 @@ struct _IBusIMContext {
+
+ /* cancellable */
+ GCancellable *cancellable;
++ GQueue *events_queue;
+ };
+
+ struct _IBusIMContextClass {
+@@ -154,6 +157,8 @@ static GType _ibus_type_im_context = 0;
+ static GtkIMContextClass *parent_class = NULL;
+
+ static IBusBus *_bus = NULL;
++static guint _daemon_name_watch_id = 0;
++static gboolean _daemon_is_running = FALSE;
+
+ void
+ ibus_im_context_register_type (GTypeModule *type_module)
+@@ -261,6 +266,46 @@ _process_key_event_done (GObject *object,
+ gdk_event_free ((GdkEvent *)event);
+ }
+
++static gboolean
++_process_key_event (IBusInputContext *context,
++ GdkEventKey *event)
++{
++ guint state = event->state;
++ gboolean retval = FALSE;
++
++ if (event->type == GDK_KEY_RELEASE) {
++ state |= IBUS_RELEASE_MASK;
++ }
++
++ if (_use_sync_mode) {
++ retval = ibus_input_context_process_key_event (context,
++ event->keyval,
++ event->hardware_keycode - 8,
++ state);
++ }
++ else {
++ ibus_input_context_process_key_event_async (context,
++ event->keyval,
++ event->hardware_keycode - 8,
++ state,
++ -1,
++ NULL,
++ _process_key_event_done,
++ gdk_event_copy ((GdkEvent *) event));
++
++ retval = TRUE;
++ }
++
++ if (retval) {
++ event->state |= IBUS_HANDLED_MASK;
++ }
++ else {
++ event->state |= IBUS_IGNORED_MASK;
++ }
++
++ return retval;
++}
++
+
+ /* emit "retrieve-surrounding" glib signal of GtkIMContext, if
+ * context->caps has IBUS_CAP_SURROUNDING_TEXT and the current IBus
+@@ -387,38 +432,7 @@ _key_snooper_cb (GtkWidget *widget,
+ ibusimcontext->time = event->time;
+ }
+
+- guint state = event->state;
+- if (event->type == GDK_KEY_RELEASE) {
+- state |= IBUS_RELEASE_MASK;
+- }
+-
+- if (_use_sync_mode) {
+- retval = ibus_input_context_process_key_event (
+- ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state);
+- }
+- else {
+- ibus_input_context_process_key_event_async (
+- ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state,
+- -1,
+- NULL,
+- _process_key_event_done,
+- gdk_event_copy ((GdkEvent *) event));
+- retval = TRUE;
+-
+- }
+-
+- if (retval) {
+- event->state |= IBUS_HANDLED_MASK;
+- }
+- else {
+- event->state |= IBUS_IGNORED_MASK;
+- }
++ retval = _process_key_event (ibuscontext, event);
+
+ if (ibusimcontext != NULL) {
+ /* unref ibusimcontext could call ibus_im_context_finalize here
+@@ -450,6 +464,23 @@ _get_boolean_env(const gchar *name,
+ }
+
+ static void
++daemon_name_appeared (GDBusConnection *connection,
++ const gchar *name,
++ const gchar *owner,
++ gpointer data)
++{
++ _daemon_is_running = TRUE;
++}
++
++static void
++daemon_name_vanished (GDBusConnection *connection,
++ const gchar *name,
++ gpointer data)
++{
++ _daemon_is_running = FALSE;
++}
++
++static void
+ ibus_im_context_class_init (IBusIMContextClass *class)
+ {
+ IDEBUG ("%s", __FUNCTION__);
+@@ -533,6 +564,14 @@ ibus_im_context_class_init (IBusIMContextClass *class)
+ /* always install snooper */
+ if (_key_snooper_id == 0)
+ _key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL);
++
++ _daemon_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
++ IBUS_SERVICE_IBUS,
++ G_BUS_NAME_WATCHER_FLAGS_NONE,
++ daemon_name_appeared,
++ daemon_name_vanished,
++ NULL,
++ NULL);
+ }
+
+ static void
+@@ -543,6 +582,8 @@ ibus_im_context_class_fini (IBusIMContextClass *class)
+ gtk_key_snooper_remove (_key_snooper_id);
+ _key_snooper_id = 0;
+ }
++
++ g_bus_unwatch_name (_daemon_name_watch_id);
+ }
+
+ /* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
+@@ -602,6 +643,7 @@ ibus_im_context_init (GObject *obj)
+ ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
+ #endif
+
++ ibusimcontext->events_queue = g_queue_new ();
+
+ // Create slave im context
+ ibusimcontext->slave = gtk_im_context_simple_new ();
+@@ -651,6 +693,13 @@ ibus_im_context_finalize (GObject *obj)
+
+ g_signal_handlers_disconnect_by_func (_bus, G_CALLBACK (_bus_connected_cb), obj);
+
++ if (ibusimcontext->cancellable != NULL) {
++ /* Cancel any ongoing create input context request */
++ g_cancellable_cancel (ibusimcontext->cancellable);
++ g_object_unref (ibusimcontext->cancellable);
++ ibusimcontext->cancellable = NULL;
++ }
++
+ if (ibusimcontext->ibuscontext) {
+ ibus_proxy_destroy ((IBusProxy *)ibusimcontext->ibuscontext);
+ }
+@@ -670,6 +719,9 @@ ibus_im_context_finalize (GObject *obj)
+ pango_attr_list_unref (ibusimcontext->preedit_attrs);
+ }
+
++ g_queue_free_full (ibusimcontext->events_queue,
++ (GDestroyNotify)gdk_event_free);
++
+ G_OBJECT_CLASS(parent_class)->finalize (obj);
+ }
+
+@@ -681,65 +733,56 @@ ibus_im_context_filter_keypress (GtkIMContext *context,
+
+ IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context);
+
+- if (G_LIKELY (ibusimcontext->ibuscontext && ibusimcontext->has_focus)) {
+- /* If context does not have focus, ibus will process key event in sync mode.
+- * It is a workaround for increase search in treeview.
+- */
+- gboolean retval = FALSE;
+-
+- if (event->state & IBUS_HANDLED_MASK)
+- return TRUE;
++ if (!_daemon_is_running)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- if (event->state & IBUS_IGNORED_MASK)
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
++ /* If context does not have focus, ibus will process key event in
++ * sync mode. It is a workaround for increase search in treeview.
++ */
++ if (!ibusimcontext->has_focus)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- /* XXX it is a workaround for some applications do not set client window. */
+- if (ibusimcontext->client_window == NULL && event->window != NULL)
+- gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext, event->window);
++ if (event->state & IBUS_HANDLED_MASK)
++ return TRUE;
+
+- _request_surrounding_text (ibusimcontext);
++ if (event->state & IBUS_IGNORED_MASK)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- if (ibusimcontext != NULL) {
+- ibusimcontext->time = event->time;
+- }
++ /* XXX it is a workaround for some applications do not set client
++ * window. */
++ if (ibusimcontext->client_window == NULL && event->window != NULL)
++ gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext,
++ event->window);
+
+- guint state = event->state;
+- if (event->type == GDK_KEY_RELEASE) {
+- state |= IBUS_RELEASE_MASK;
+- }
++ _request_surrounding_text (ibusimcontext);
+
+- if (_use_sync_mode) {
+- retval = ibus_input_context_process_key_event (
+- ibusimcontext->ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state);
+- }
+- else {
+- ibus_input_context_process_key_event_async (
+- ibusimcontext->ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state,
+- -1,
+- NULL,
+- _process_key_event_done,
+- gdk_event_copy ((GdkEvent *) event));
+- retval = TRUE;
+- }
++ ibusimcontext->time = event->time;
+
+- if (retval) {
+- event->state |= IBUS_HANDLED_MASK;
++ if (ibusimcontext->ibuscontext) {
++ if (_process_key_event (ibusimcontext->ibuscontext, event))
+ return TRUE;
+- }
+- else {
+- event->state |= IBUS_IGNORED_MASK;
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+- }
++ else
++ return gtk_im_context_filter_keypress (ibusimcontext->slave,
++ event);
+ }
+- else {
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
++
++ /* At this point we _should_ be waiting for the IBus context to be
++ * created or the connection to IBus to be established. If that's
++ * the case we queue events to be processed when the IBus context
++ * is ready. */
++ g_return_val_if_fail (ibusimcontext->cancellable != NULL ||
++ ibus_bus_is_connected (_bus) == FALSE,
++ FALSE);
++ g_queue_push_tail (ibusimcontext->events_queue,
++ gdk_event_copy ((GdkEvent *)event));
++
++ if (g_queue_get_length (ibusimcontext->events_queue) > MAX_QUEUED_EVENTS) {
++ g_warning ("Events queue growing too big, will start to drop.");
++ gdk_event_free ((GdkEvent *)
++ g_queue_pop_head (ibusimcontext->events_queue));
+ }
++
++ return TRUE;
+ }
+
+ static void
+@@ -1482,6 +1525,14 @@ _create_input_context_done (IBusBus *bus,
+ ibus_input_context_focus_in (ibusimcontext->ibuscontext);
+ _set_cursor_location_internal (ibusimcontext);
+ }
++
++ if (!g_queue_is_empty (ibusimcontext->events_queue)) {
++ GdkEventKey *event;
++ while (event = g_queue_pop_head (ibusimcontext->events_queue)) {
++ _process_key_event (context, event);
++ gdk_event_free ((GdkEvent *)event);
++ }
++ }
+ }
+
+ g_object_unref (ibusimcontext);
+@@ -1494,12 +1545,7 @@ _create_input_context (IBusIMContext *ibusimcontext)
+
+ g_assert (ibusimcontext->ibuscontext == NULL);
+
+- if (ibusimcontext->cancellable != NULL) {
+- /* Cancel previous create input context request */
+- g_cancellable_cancel (ibusimcontext->cancellable);
+- g_object_unref (ibusimcontext->cancellable);
+- ibusimcontext->cancellable = NULL;
+- }
++ g_return_if_fail (ibusimcontext->cancellable == NULL);
+
+ ibusimcontext->cancellable = g_cancellable_new ();
+
--
1.8.0
diff --git a/ibus-xx-f17.patch b/ibus-xx-f17.patch
new file mode 100644
index 0000000..01bffe3
--- /dev/null
+++ b/ibus-xx-f17.patch
@@ -0,0 +1,91 @@
+--- ibus-1.5.1/bindings/vala/Makefile.am.orig 2013-01-15 16:58:25.571433690 +0900
++++ ibus-1.5.1/bindings/vala/Makefile.am 2013-01-15 16:58:46.983455158 +0900
+@@ -20,17 +20,38 @@
+ # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ # Boston, MA 02111-1307 USA
+
+--include $(VAPIGEN_MAKEFILE)
++vapidir = $(datadir)/vala/vapi
++dist_vapi_DATA = \
++ ibus-@IBUS_API_VERSION@.vapi \
++ ibus-@IBUS_API_VERSION@.deps \
++ $(NULL)
+
++# Don't rebuild vapi every time gir is updated.
++if ENABLE_LIBGNOMEKBD
+ vapi_deps = \
+- IBus-1.0.metadata \
+- IBus-1.0-custom.vala \
+- $(top_builddir)/src/IBus-1.0.gir \
++ $(srcdir)/IBus-1.0.metadata \
++ $(srcdir)/IBus-1.0-custom.vala \
++ | \
++ $(builddir)/gkbd.vapi \
++ $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
+ $(NULL)
++else
++vapi_deps = \
++ $(srcdir)/IBus-1.0.metadata \
++ $(srcdir)/IBus-1.0-custom.vala \
++ | \
++ $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
++ $(NULL)
++endif
+
+-if ENABLE_LIBGNOMEKBD
+-vapi_deps += $(builddir)/gkbd.vapi
++ibus-@IBUS_API_VERSION@.vapi: $(vapi_deps)
++ $(AM_V_GEN) $(VAPIGEN) --library ibus-@IBUS_API_VERSION@ \
++ --pkg gio-2.0 \
++ --metadatadir=$(srcdir) \
++ $(top_srcdir)/src/IBus-@IBUS_API_VERSION@.gir \
++ $(srcdir)/IBus-1.0-custom.vala
+
++if ENABLE_LIBGNOMEKBD
+ $(builddir)/gkbd.vapi:
+ $(AM_V_GEN) $(VAPIGEN) --library gkbd \
+ --metadatadir $(srcdir) \
+@@ -39,25 +60,10 @@ $(builddir)/gkbd.vapi:
+ $(NULL)
+ endif
+
+-ibus-1.0.vapi: $(vapi_deps)
+-
+-VAPIGEN_VAPIS = ibus-1.0.vapi
+-
+-ibus_1_0_vapi_DEPS = gio-2.0
+-ibus_1_0_vapi_METADATADIRS = $(srcdir)
+-ibus_1_0_vapi_FILES = \
+- $(top_builddir)/src/IBus-1.0.gir \
+- $(srcdir)/IBus-1.0-custom.vala \
+- $(NULL)
+-
+-vapidir = $(datadir)/vala/vapi
+-vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
+-
+ EXTRA_DIST = \
+ Gkbd-3.0.metadata \
+ IBus-1.0.metadata \
+ IBus-1.0-custom.vala \
+- ibus-1.0.deps \
+ config.vapi \
+ xi.vapi \
+ Xkl-1.0.metadata \
+@@ -65,4 +71,6 @@ EXTRA_DIST = \
+
+ CLEANFILES = gkbd.vapi
+
++MAINTAINERCLEANFILES = ibus-@IBUS_API_VERSION@.vapi
++
+ -include $(top_srcdir)/git.mk
+--- ibus-1.5.1/setup/keyboardshortcut.py.orig 2013-01-15 17:00:05.093191054 +0900
++++ ibus-1.5.1/setup/keyboardshortcut.py 2013-01-15 17:00:18.034160760 +0900
+@@ -207,7 +207,7 @@ class KeyboardShortcutSelection(Gtk.VBox
+ def __set_selected_shortcut(self, shortcut):
+ model = self.__shortcut_view.get_model()
+ path, column = self.__shortcut_view.get_cursor()
+- model[path[0]][0] = shortcut
++ model[path][0] = shortcut
+ self.__update_add_and_apply_buttons()
+
+ def __del_selected_shortcut(self):
diff --git a/ibus-xx-g-s-disable-preedit.patch b/ibus-xx-g-s-disable-preedit.patch
index 6bc62cc..e5c5e36 100644
--- a/ibus-xx-g-s-disable-preedit.patch
+++ b/ibus-xx-g-s-disable-preedit.patch
@@ -12,10 +12,10 @@ diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index 584b92d..c4c61d3 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
-@@ -584,6 +584,14 @@ ibus_im_context_init (GObject *obj)
- #else
- ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
- #endif
+@@ -645,6 +645,15 @@ ibus_im_context_init (GObject *obj)
+
+ ibusimcontext->events_queue = g_queue_new ();
+
+ if (!g_getenv ("IBUS_GNOME_SHELL_ENABLE_PREEDIT_TEXT")) {
+ const gchar * prgname = g_get_prgname ();
+ if (g_strcmp0 (prgname, "gnome-shell") == 0) {
@@ -24,9 +24,10 @@ index 584b92d..c4c61d3 100644
+ }
+ }
+ }
-
-
++
// Create slave im context
+ ibusimcontext->slave = gtk_im_context_simple_new ();
+ gtk_im_context_simple_add_table (GTK_IM_CONTEXT_SIMPLE (ibusimcontext->slave),
--
1.7.10.4
diff --git a/ibus-xx-no-use.diff b/ibus-xx-no-use.diff
deleted file mode 100644
index df996c9..0000000
--- a/ibus-xx-no-use.diff
+++ /dev/null
@@ -1,484 +0,0 @@
-From fdec59545fb94f768c847730854ca03c5af2f652 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 7 Dec 2012 17:59:49 +0900
-Subject: [PATCH] Disabled to show non-used GUI.
-
----
- setup/keyboardshortcut.py | 90 ++++++++++++++++++++++++-----------------------
- setup/main.py | 45 +++++++++++++-----------
- setup/setup.ui | 51 +++++++++++++++++----------
- 3 files changed, 103 insertions(+), 83 deletions(-)
-
-diff --git a/setup/keyboardshortcut.py b/setup/keyboardshortcut.py
-index 3861d2f..9349e42 100644
---- a/setup/keyboardshortcut.py
-+++ b/setup/keyboardshortcut.py
-@@ -103,9 +103,8 @@ class KeyboardShortcutSelection(Gtk.VBox):
- self.__modifier_buttons.append(("Hyper",
- Gtk.CheckButton.new_with_mnemonic("_Hyper"),
- Gdk.ModifierType.HYPER_MASK))
-- self.__modifier_buttons.append(("Capslock",
-- Gtk.CheckButton.new_with_mnemonic("Capsloc_k"),
-- Gdk.ModifierType.LOCK_MASK))
-+ # <CapsLock> is not parsed by gtk_accelerator_parse()
-+ # FIXME: Need to check if ibus gtk panel can enable <Release>.
- self.__modifier_buttons.append(("Release",
- Gtk.CheckButton.new_with_mnemonic("_Release"),
- Gdk.ModifierType.RELEASE_MASK))
-@@ -119,7 +118,6 @@ class KeyboardShortcutSelection(Gtk.VBox):
- table.attach(self.__modifier_buttons[4][1], 0, 1, 1, 2)
- table.attach(self.__modifier_buttons[5][1], 1, 2, 1, 2)
- table.attach(self.__modifier_buttons[6][1], 2, 3, 1, 2)
-- table.attach(self.__modifier_buttons[7][1], 3, 4, 1, 2)
- hbox.pack_start(table, True, True, 4)
- self.pack_start(hbox, False, True, 4)
-
-@@ -185,19 +183,20 @@ class KeyboardShortcutSelection(Gtk.VBox):
- modifiers.append(name)
- if keycode.startswith("_"):
- keycode = keycode[1:]
-- keys = modifiers + [keycode]
-- shortcut = "+".join(keys)
-+ shortcut = "".join(map(lambda m: '<' + m + '>', modifiers))
-+ shortcut += keycode
- return shortcut
-
- def __set_shortcut_to_buttons(self, shortcut):
-- keys = shortcut.split("+")
-- mods = keys[:-1]
-+ (keyval, state) = Gtk.accelerator_parse(shortcut)
-+ if keyval == 0 and state == 0:
-+ return
- for name, button, mask in self.__modifier_buttons:
-- if name in mods:
-+ if state & mask:
- button.set_active(True)
- else:
- button.set_active(False)
-- self.__keycode_entry.set_text(keys[-1])
-+ self.__keycode_entry.set_text(shortcut.rsplit('>', 1)[-1])
-
- def __get_selected_shortcut(self):
- model = self.__shortcut_view.get_model()
-@@ -252,49 +251,52 @@ class KeyboardShortcutSelection(Gtk.VBox):
- message = _("Please press a key (or a key combination).\nThe dialog will be closed when the key is released.")
- dlg.set_markup(message)
- dlg.set_title(_("Please press a key (or a key combination)"))
--
-- def __key_press_event(d, k, out):
-- out.append(k.copy())
--
-- def __key_release_event(d, k, out):
-- d.response(Gtk.ResponseType.OK)
--
-- dlg.connect("key-press-event", __key_press_event, out)
-- dlg.connect("key-release-event", __key_release_event, None)
-+ sw = Gtk.ScrolledWindow()
-+
-+ def __accel_edited_cb(c, path, keyval, state, keycode):
-+ out.append(keyval)
-+ out.append(state)
-+ out.append(keycode)
-+ dlg.response(Gtk.ResponseType.OK)
-+
-+ model = Gtk.ListStore(GObject.TYPE_INT,
-+ GObject.TYPE_UINT,
-+ GObject.TYPE_UINT)
-+ accel_view = Gtk.TreeView(model)
-+ sw.add(accel_view)
-+ column = Gtk.TreeViewColumn()
-+ renderer = Gtk.CellRendererAccel(accel_mode=Gtk.CellRendererAccelMode.OTHER,
-+ editable=True)
-+ renderer.connect('accel-edited', __accel_edited_cb)
-+ column.pack_start(renderer, True)
-+ column.add_attribute(renderer, 'accel-mods', 0)
-+ column.add_attribute(renderer, 'accel-key', 1)
-+ column.add_attribute(renderer, 'keycode', 2)
-+ accel_view.append_column(column)
-+ it = model.append(None)
-+ area = dlg.get_message_area()
-+ area.pack_end(sw, True, True, 0)
-+ sw.show_all()
- id = dlg.run()
- dlg.destroy()
-- if id != Gtk.ResponseType.OK or not out:
-+ if id != Gtk.ResponseType.OK or len(out) < 3:
- return
-- keyevent = out[len(out) - 1]
-- state = keyevent.state & (Gdk.ModifierType.CONTROL_MASK | \
-- Gdk.ModifierType.SHIFT_MASK | \
-- Gdk.ModifierType.MOD1_MASK | \
-- Gdk.ModifierType.META_MASK | \
-- Gdk.ModifierType.SUPER_MASK | \
-- Gdk.ModifierType.HYPER_MASK)
--
--
-- if state == 0:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Control_L, Gdk.KEY_Control_R) and state == Gdk.ModifierType.CONTROL_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Shift_L, Gdk.KEY_Shift_R) and state == Gdk.ModifierType.SHIFT_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Alt_L, Gdk.KEY_Alt_R) and state == Gdk.ModifierType.MOD1_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Meta_L, Gdk.KEY_Meta_R) and state == Gdk.ModifierType.META_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Super_L, Gdk.KEY_Super_R) and state == Gdk.ModifierType.SUPER_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-- elif keyevent.keyval in (Gdk.KEY_Hyper_L, Gdk.KEY_Hyper_R) and state == Gdk.ModifierType.HYPER_MASK:
-- state = state | Gdk.ModifierType.RELEASE_MASK
-+ keyval = out[0]
-+ state = out[1]
-+ keycode = out[2]
-
- for name, button, mask in self.__modifier_buttons:
- if state & mask:
- button.set_active(True)
- else:
- button.set_active(False)
-- self.__keycode_entry.set_text(Gdk.keyval_name(keyevent.keyval))
-+
-+ shortcut = Gtk.accelerator_name_with_keycode(None,
-+ keyval,
-+ keycode,
-+ state)
-+ shortcut = shortcut.replace('<Primary>', '<Control>')
-+ self.__keycode_entry.set_text(shortcut.rsplit('>', 1)[-1])
-
- def __add_button_clicked_cb(self, button):
- shortcut = self.__get_shortcut_from_buttons()
-diff --git a/setup/main.py b/setup/main.py
-index 46209b6..aa8e935 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -92,22 +92,24 @@ class Setup(object):
- self.__init_ui()
-
- def __init_hotkey(self):
-- default_values = {
-- "trigger" : (N_("trigger"), ["Control+space"]),
-- "enable_unconditional" : (N_("enable"), []),
-- "disable_unconditional" : (N_("disable"), [])
-- }
--
-- values = dict(self.__config.get_values("general/hotkey"))
--
-- for name, (label, shortcuts) in default_values.items():
-- shortcuts = values.get(name, shortcuts)
-- button = self.__builder.get_object("button_%s" % name)
-- entry = self.__builder.get_object("entry_%s" % name)
-- entry.set_text("; ".join(shortcuts))
-- entry.set_tooltip_text("\n".join(shortcuts))
-- button.connect("clicked", self.__shortcut_button_clicked_cb,
-- label, "general/hotkey", name, entry)
-+ name = 'trigger_accel'
-+ label = 'switch_engine'
-+ variant = self.__config.get_value('general/hotkey', name)
-+ if variant != None:
-+ shortcuts = variant.unpack()
-+ else:
-+ shortcuts = ['<Control>space']
-+
-+ button = self.__builder.get_object("button_%s" % label)
-+ entry = self.__builder.get_object("entry_%s" % label)
-+ entry.set_text("; ".join(shortcuts))
-+ tooltip = "\n".join(shortcuts)
-+ tooltip += "\n" + \
-+ _("Use shortcut with shift to switch to the previous input method")
-+
-+ entry.set_tooltip_text(tooltip)
-+ button.connect("clicked", self.__shortcut_button_clicked_cb,
-+ name, "general/hotkey", label, entry)
-
- def __init_panel(self):
- values = dict(self.__config.get_values("panel"))
-@@ -449,7 +451,8 @@ class Setup(object):
- def __shortcut_button_clicked_cb(self, button, name, section, _name, entry):
- buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_OK, Gtk.ResponseType.OK)
-- title = _("Select keyboard shortcut for %s") % _(name)
-+ title = _("Select keyboard shortcut for %s") % \
-+ _("switching input methods")
- dialog = keyboardshortcut.KeyboardShortcutSelectionDialog(buttons = buttons, title = title)
- text = entry.get_text()
- if text:
-@@ -462,11 +465,13 @@ class Setup(object):
- dialog.destroy()
- if id != Gtk.ResponseType.OK:
- return
-- self.__config.set_value(section, _name, GLib.Variant.new_strv(shortcuts))
-+ self.__config.set_value(section, name, GLib.Variant.new_strv(shortcuts))
- text = "; ".join(shortcuts)
- entry.set_text(text)
-- entry.set_tooltip_text(text)
--
-+ tooltip = "\n".join(shortcuts)
-+ tooltip += "\n" + \
-+ _("Use shortcut with shift to switch to the previous input method")
-+ entry.set_tooltip_text(tooltip)
-
- def __item_started_column_toggled_cb(self, cell, path_str, model):
-
-diff --git a/setup/setup.ui b/setup/setup.ui
-index 2026172..aa41453 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -121,8 +121,7 @@
- </child>
- <child>
- <object class="GtkLabel" id="label9">
-- <property name="visible">True</property>
-- <property name="sensitive">False</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">The shortcut keys for switching to previous input method in the list</property>
- <property name="xalign">0</property>
-@@ -137,7 +136,7 @@
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
-@@ -172,6 +171,7 @@
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -180,7 +180,7 @@
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
-- <object class="GtkEntry" id="entry_next_engine">
-+ <object class="GtkEntry" id="entry_switch_engine">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
-@@ -192,7 +192,7 @@
- </packing>
- </child>
- <child>
-- <object class="GtkButton" id="button_next_engine">
-+ <object class="GtkButton" id="button_switch_engine">
- <property name="label" translatable="yes">...</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
-@@ -213,17 +213,17 @@
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox6">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkEntry" id="entry_prev_engine">
-- <property name="visible">True</property>
-- <property name="sensitive">False</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- </object>
-@@ -237,8 +237,7 @@
- <object class="GtkButton" id="button_prev_engine">
- <property name="label" translatable="yes">...</property>
- <property name="use_action_appearance">False</property>
-- <property name="visible">True</property>
-- <property name="sensitive">False</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
-@@ -256,11 +255,12 @@
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label7">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">The shortcut keys for turning input method on or off</property>
- <property name="xalign">0</property>
-@@ -273,7 +273,7 @@
- </child>
- <child>
- <object class="GtkLabel" id="label18">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Enable:</property>
-@@ -287,7 +287,7 @@
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
-@@ -324,11 +324,12 @@
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label19">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Disable:</property>
-@@ -342,7 +343,7 @@
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
-@@ -379,6 +380,7 @@
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- </object>
-@@ -431,6 +433,7 @@
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -448,11 +451,12 @@
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label10">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Set the behavior of ibus how to show or hide language bar</property>
- <property name="xalign">0</property>
-@@ -463,6 +467,7 @@
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -477,11 +482,12 @@
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="combobox_panel_show">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="model">model_panel_show_mode</property>
- <child>
-@@ -496,6 +502,7 @@
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -515,6 +522,7 @@
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -534,13 +542,14 @@
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_show_im_name">
- <property name="label" translatable="yes">Show input method name on language bar</property>
- <property name="use_action_appearance">False</property>
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Show input method's name on language bar when check the checkbox</property>
-@@ -553,6 +562,7 @@
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -572,6 +582,7 @@
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -590,6 +601,7 @@
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">GTK_FILL</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
-@@ -605,6 +617,7 @@
- <property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
-+ <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- </object>
-@@ -1001,7 +1014,7 @@ You may use up/down buttons to change it.</i></small></property>
- </child>
- <child>
- <object class="GtkFrame" id="frame5">
-- <property name="visible">True</property>
-+ <property name="no_show_all">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
---
-1.8.0
-
diff --git a/ibus-xx-setup-frequent-lang.patch b/ibus-xx-setup-frequent-lang.patch
index beddad3..d8d7b4b 100644
--- a/ibus-xx-setup-frequent-lang.patch
+++ b/ibus-xx-setup-frequent-lang.patch
@@ -1,6 +1,6 @@
-From 58d4c946db3396897f36f71d33e939dfbbf0ebed Mon Sep 17 00:00:00 2001
+From 7c4c048bd5aceb15d44042c72ff931d0c05d440f Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 27 Nov 2012 15:53:34 +0900
+Date: Fri, 11 Jan 2013 23:04:53 +0900
Subject: [PATCH] Enable ibus-setup to show the frequently used languages
only in IME list.
@@ -11,10 +11,10 @@ Subject: [PATCH] Enable ibus-setup to show the frequently used languages
3 files changed, 300 insertions(+), 24 deletions(-)
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index 64f6f33..23739af 100644
+index 7833959..72bcc72 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
-@@ -348,6 +348,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn
+@@ -325,6 +325,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn
</locale>
</schema>
<schema>
@@ -190,7 +190,7 @@ index 64f6f33..23739af 100644
<applyto>/desktop/ibus/panel/custom_font</applyto>
<owner>ibus</owner>
diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
-index f80b164..578098c 100644
+index 0f8a6ae..9828ee6 100644
--- a/setup/enginecombobox.py
+++ b/setup/enginecombobox.py
@@ -45,6 +45,9 @@ class EngineComboBox(Gtk.ComboBox):
@@ -362,7 +362,7 @@ index f80b164..578098c 100644
else:
renderer.set_property("visible", True)
renderer.set_property("sensitive", True)
-@@ -124,7 +215,8 @@ class EngineComboBox(Gtk.ComboBox):
+@@ -119,7 +210,8 @@ class EngineComboBox(Gtk.ComboBox):
renderer.set_property("pixbuf", pixbuf)
def __name_cell_data_cb(self, celllayout, renderer, model, iter, data):
@@ -372,7 +372,7 @@ index f80b164..578098c 100644
if isinstance (engine, str) or isinstance (engine, unicode):
renderer.set_property("sensitive", False)
-@@ -132,8 +224,15 @@ class EngineComboBox(Gtk.ComboBox):
+@@ -127,8 +219,15 @@ class EngineComboBox(Gtk.ComboBox):
renderer.set_property("weight", Pango.Weight.NORMAL)
elif isinstance(engine, int):
renderer.set_property("sensitive", True)
@@ -390,7 +390,7 @@ index f80b164..578098c 100644
else:
renderer.set_property("sensitive", True)
renderer.set_property("text", engine.get_longname())
-@@ -149,10 +248,18 @@ class EngineComboBox(Gtk.ComboBox):
+@@ -144,10 +243,18 @@ class EngineComboBox(Gtk.ComboBox):
if i == 0 or i == -1:
return None
iter = self.get_active_iter()
@@ -411,17 +411,17 @@ index f80b164..578098c 100644
return self.get_property("active-engine")
diff --git a/setup/main.py b/setup/main.py
-index 5da6340..d6fa3ef 100644
+index aae6bb9..ded85c0 100644
--- a/setup/main.py
+++ b/setup/main.py
-@@ -224,6 +224,7 @@ class Setup(object):
- engines.append(engine)
-
+@@ -207,6 +207,7 @@ class Setup(object):
+ # init engine page
+ self.__engines = self.__bus.list_engines()
self.__combobox = self.__builder.get_object("combobox_engines")
+ self.__combobox.set_config(self.__config)
- self.__combobox.set_engines(engines)
+ self.__combobox.set_engines(self.__engines)
- engine_names = values.get("preload_engines", [])
+ tmp_dict = {}
--
1.8.0
diff --git a/ibus.spec b/ibus.spec
index c981569..02958f5 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -17,7 +17,7 @@
%global with_gkbd 1
%endif
-%global ibus_gjs_version 3.4.1.20120815
+%global ibus_gjs_version 3.4.1.20130115
%global ibus_api_version 1.0
@@ -32,12 +32,10 @@
%endif
%global dbus_python_version 0.83.0
-# FIXME: It's better to use the new icon names
-%global gnome_icon_theme_legacy_version 2.91.6
Name: ibus
-Version: 1.4.99.20121109
-Release: 9%{?dist}
+Version: 1.5.1
+Release: 1%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@@ -48,10 +46,6 @@ Source1: %{name}-xinput
# ibus-gjs
Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/%{name}-gjs-%{ibus_gjs_version}.tar.gz
%endif
-%if (0%{?fedora} < 19 && 0%{?rhel} < 7)
-# Upstreamed translations.
-Source3: http://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.4.99.20121207.tar.gz
-%endif
# Upstreamed patches.
Patch0: %{name}-HEAD.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=810211
@@ -68,8 +62,10 @@ Patch4: %{name}-xx-setup-frequent-lang.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=658420
Patch92: %{name}-xx-g-s-disable-preedit.patch
%endif
-# Hide no nused properties in f17.
-Patch94: %{name}-xx-no-use.diff
+%if (0%{?fedora} < 18 && 0%{?rhel} < 7)
+# The patch enables to build on fedora 17.
+Patch93: %{name}-xx-f17.patch
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -91,6 +87,7 @@ BuildRequires: vala-tools
BuildRequires: GConf2-devel
%if %with_pygobject3
BuildRequires: gobject-introspection-devel
+BuildRequires: pygobject3-devel
%endif
BuildRequires: intltool
BuildRequires: iso-codes-devel
@@ -132,7 +129,6 @@ Requires: notify-python
Requires: libgnomekbd
%endif
Requires: librsvg2
-Requires: gnome-icon-theme-legacy >= %{gnome_icon_theme_legacy_version}
%if (0%{?fedora} <= 17 && 0%{?rhel} < 7)
Requires: gnome-icon-theme-symbolic
%endif
@@ -230,9 +226,6 @@ The ibus-devel-docs package contains developer documentation for ibus
%if %with_gjs
gzip -dc %SOURCE2 | tar xf -
%endif
-%if (0%{?fedora} < 19 && 0%{?rhel} < 7)
-gzip -dc %SOURCE3 | tar xf -
-%endif
# home [dot] corp [dot] redhat [dot] com/wiki/rpmdiff-multilib
# Update timestamps on the files touched by a patch, to avoid non-equal
@@ -270,8 +263,10 @@ UpdateTimestamps -p1 %{PATCH3}
%patch4 -p1 -b .setup-frequent-lang
UpdateTimestamps -p1 %{PATCH4}
-%patch94 -p1 -b .no-used
-UpdateTimestamps -p1 %{PATCH94}
+%if (0%{?fedora} < 18 && 0%{?rhel} < 7)
+%patch93 -p1 -b .f17
+UpdateTimestamps -p1 %{PATCH93}
+%endif
%build
%if %with_xkbfile
@@ -285,17 +280,12 @@ autoreconf -f -i
--enable-gtk-doc \
--with-no-snooper-apps='gnome-do,Do.*,firefox.*,.*chrome.*,.*chromium.*' \
--enable-surrounding-text \
-%if (0%{?fedora} > 17 || 0%{?rhel} > 6)
- --with-panel-icon-keyboard=legacy \
-%endif
-%if %with_xkbfile
- --with-xkb-command=ibus-xkb \
+%if (0%{?fedora} <= 17 && 0%{?rhel} < 7)
+ --with-panel-icon-keyboard=yes \
%endif
%if %with_gkbd
--enable-libgnomekbd \
%endif
- --enable-dconf \
- --disable-gconf \
%if %with_pygobject2
--enable-python-library \
%endif
@@ -448,10 +438,8 @@ fi
%{_sysconfdir}/bash_completion.d/ibus.bash
%{_sysconfdir}/dconf/db/ibus.d
%{_sysconfdir}/dconf/profile/ibus
+%python2_sitearch/gi/overrides/IBus.py*
%config %{_xinputconf}
-%if %with_xkbfile
-%{_libexecdir}/ibus-xkb
-%endif
%files libs
%{_libdir}/libibus-%{ibus_api_version}.so.*
@@ -483,6 +471,11 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
+* Tue Jan 08 2013 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.1-1
+- Bumped to 1.5.1
+- Bumped to ibus-gjs 3.4.1.20130115 for f17
+- Removed ibus-xx-no-use.diff
+
* Fri Dec 14 2012 Takao Fujiwara <tfujiwar@redhat.com> - 1.4.99.20121109-9
- Updated ibus-xx-no-use.diff not to use variant.dup_strv()
diff --git a/sources b/sources
index aa61f95..ce31a01 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,3 @@
-be482479357210283e91a47f43a0a0fe ibus-1.4.99.20121109.tar.gz
+f0103201249c657712f5f4d9a36923ed ibus-1.5.1.tar.gz
2d2ad58e3e41429dbd883ba7e501c9b2 ibus-gjs-3.2.1.20111230.tar.gz
-8acf4ac4d1a7dfb9a0af9e755a8e7dba ibus-gjs-3.4.1.20120815.tar.gz
-e2a13c45eea2cdb86572bbccec7a2e16 ibus-po-1.4.99.20121207.tar.gz
+da9a22c82ab33423d7afeb3da4146fa8 ibus-gjs-3.4.1.20130115.tar.gz
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-31 2:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 2:05 [rpms/ibus] autotool: Bumped to 1.5.1 Takao Fujiwara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox