[Fedora-i18n-bugs] [ibus-m17n/f15] Update to 1.3.2-7; migrate to quilt.
Daiki Ueno
ueno at fedoraproject.org
Thu Jul 7 07:58:52 UTC 2011
commit f19c5d44cef4cba226ef82f128fa13cda3f9aead
Author: Daiki Ueno <ueno at unixuser.org>
Date: Thu Jul 7 16:58:24 2011 +0900
Update to 1.3.2-7; migrate to quilt.
ibus-m17n-HEAD.patch | 52 ++++--
ibus-m17n-iok.patch | 35 ++---
ibus-m17n-stscap.patch | 38 ----
ibus-m17n-stsreq.patch | 33 ----
ibus-m17n-xkb-options.patch | 386 ++++++++++++++++++++++++++++++++++++++++
ibus-m17n-xx-icon-symbol.patch | 130 ++++++++++++++
ibus-m17n.spec | 50 ++++--
series | 4 +
8 files changed, 604 insertions(+), 124 deletions(-)
---
diff --git a/ibus-m17n-HEAD.patch b/ibus-m17n-HEAD.patch
index 9b98dea..9c3f6bd 100644
--- a/ibus-m17n-HEAD.patch
+++ b/ibus-m17n-HEAD.patch
@@ -1,7 +1,8 @@
-diff --git a/Makefile.am b/Makefile.am
-index eac3b9d..14a674d 100644
---- a/Makefile.am
-+++ b/Makefile.am
+Patch to synch with the git master 65cc1bc1.
+Index: ibus-m17n-1.3.2/Makefile.am
+===================================================================
+--- ibus-m17n-1.3.2.orig/Makefile.am
++++ ibus-m17n-1.3.2/Makefile.am
@@ -69,7 +69,7 @@ debian/changelog:
version=@VERSION@; \
serie=$(serie); \
@@ -11,10 +12,10 @@ index eac3b9d..14a674d 100644
fi; \
if test -z "$$release"; then \
release=1; \
-diff --git a/configure.ac b/configure.ac
-index 17077f2..4df68b6 100644
---- a/configure.ac
-+++ b/configure.ac
+Index: ibus-m17n-1.3.2/configure.ac
+===================================================================
+--- ibus-m17n-1.3.2.orig/configure.ac
++++ ibus-m17n-1.3.2/configure.ac
@@ -89,7 +89,22 @@ fi
AM_CONDITIONAL([HAVE_GTK],[test x$with_gtk != xno])
@@ -38,10 +39,10 @@ index 17077f2..4df68b6 100644
# define GETTEXT_* variables
GETTEXT_PACKAGE=ibus-m17n
-diff --git a/src/engine.c b/src/engine.c
-index 62359c1..60816b0 100644
---- a/src/engine.c
-+++ b/src/engine.c
+Index: ibus-m17n-1.3.2/src/engine.c
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/engine.c
++++ ibus-m17n-1.3.2/src/engine.c
@@ -1,4 +1,7 @@
/* vim:set et sts=4: */
+#ifdef HAVE_CONFIG_H
@@ -85,7 +86,7 @@ index 62359c1..60816b0 100644
static void ibus_m17n_config_value_changed (IBusConfig *config,
const gchar *section,
const gchar *name,
-@@ -119,7 +102,6 @@ static void ibus_m17n_engine_update_lookup_table
+@@ -119,7 +102,6 @@ static void ibus_m17n_engine_update_look
static IBusEngineClass *parent_class = NULL;
static IBusConfig *config = NULL;
@@ -149,7 +150,7 @@ index 62359c1..60816b0 100644
}
static gboolean
-@@ -239,14 +172,14 @@ ibus_m17n_engine_get_type_for_name (const gchar *engine_name)
+@@ -239,14 +172,14 @@ ibus_m17n_engine_get_type_for_name (cons
GTypeInfo type_info = {
sizeof (IBusM17NEngineClass),
@@ -169,7 +170,7 @@ index 62359c1..60816b0 100644
};
if (!ibus_m17n_scan_engine_name (engine_name, &lang, &name)) {
-@@ -264,11 +197,10 @@ ibus_m17n_engine_get_type_for_name (const gchar *engine_name)
+@@ -264,11 +197,10 @@ ibus_m17n_engine_get_type_for_name (cons
g_assert (type == 0 || g_type_is_a (type, IBUS_TYPE_ENGINE));
if (type == 0) {
@@ -185,7 +186,7 @@ index 62359c1..60816b0 100644
}
g_free (type_name);
-@@ -408,14 +340,6 @@ ibus_m17n_config_value_changed (IBusConfig *config,
+@@ -408,14 +340,6 @@ ibus_m17n_config_value_changed (IBusConf
}
static void
@@ -200,7 +201,24 @@ index 62359c1..60816b0 100644
ibus_m17n_engine_init (IBusM17NEngine *m17n)
{
IBusText* label;
-@@ -986,8 +910,57 @@ ibus_m17n_engine_callback (MInputContext *context,
+@@ -773,6 +697,16 @@ ibus_m17n_engine_enable (IBusEngine *eng
+ IBusM17NEngine *m17n = (IBusM17NEngine *) engine;
+
+ parent_class->enable (engine);
++
++#ifdef HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT
++ /* Issue a dummy ibus_engine_get_surrounding_text() call to tell
++ input context that we will use surrounding-text. */
++ IBusText *text;
++ guint cursor_pos;
++
++ ibus_engine_get_surrounding_text (engine, &text, &cursor_pos);
++ g_object_unref (text);
++#endif /* HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT */
+ }
+
+ static void
+@@ -986,8 +920,57 @@ ibus_m17n_engine_callback (MInputContext
}
else if (command == Minput_reset) {
}
diff --git a/ibus-m17n-iok.patch b/ibus-m17n-iok.patch
index df6ef43..e73124f 100644
--- a/ibus-m17n-iok.patch
+++ b/ibus-m17n-iok.patch
@@ -1,17 +1,9 @@
-From c27a0917c26624f1741efeebe20cd5cfb8647a67 Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno at unixuser.org>
-Date: Mon, 7 Mar 2011 14:57:32 +0900
-Subject: [PATCH] Apply iok patch from Fedora.
-
----
- src/engine.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 46 insertions(+), 0 deletions(-)
-
-diff --git a/src/engine.c b/src/engine.c
-index 62359c1..362d347 100644
---- a/src/engine.c
-+++ b/src/engine.c
-@@ -37,6 +37,7 @@ struct _IBusM17NEngine {
+Patch to support iok (Indic Onscreen Keyboard).
+Index: ibus-m17n-1.3.2/src/engine.c
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/engine.c
++++ ibus-m17n-1.3.2/src/engine.c
+@@ -23,6 +23,7 @@ struct _IBusM17NEngine {
IBusProperty *setup_prop;
#endif /* HAVE_SETUP */
IBusPropList *prop_list;
@@ -19,7 +11,7 @@ index 62359c1..362d347 100644
};
struct _IBusM17NEngineClass {
-@@ -48,6 +49,7 @@ struct _IBusM17NEngineClass {
+@@ -34,6 +35,7 @@ struct _IBusM17NEngineClass {
guint preedit_background;
gint preedit_underline;
gint lookup_table_orientation;
@@ -27,7 +19,7 @@ index 62359c1..362d347 100644
MInputMethod *im;
};
-@@ -316,6 +318,9 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass)
+@@ -248,6 +250,9 @@ ibus_m17n_engine_class_init (IBusM17NEng
}
engine_name = g_strdup_printf ("m17n:%s:%s", lang, name);
klass->config_section = g_strdup_printf ("engine/M17N/%s/%s", lang, name);
@@ -37,7 +29,7 @@ index 62359c1..362d347 100644
g_free (lang);
g_free (name);
-@@ -420,6 +425,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+@@ -344,6 +349,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m
{
IBusText* label;
IBusText* tooltip;
@@ -45,7 +37,7 @@ index 62359c1..362d347 100644
m17n->prop_list = ibus_prop_list_new ();
g_object_ref_sink (m17n->prop_list);
-@@ -452,6 +458,23 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+@@ -376,6 +382,23 @@ ibus_m17n_engine_init (IBusM17NEngine *m
ibus_prop_list_append (m17n->prop_list, m17n->setup_prop);
#endif /* HAVE_SETUP */
@@ -69,7 +61,7 @@ index 62359c1..362d347 100644
m17n->table = ibus_lookup_table_new (9, 0, TRUE, TRUE);
g_object_ref_sink (m17n->table);
m17n->context = NULL;
-@@ -537,6 +560,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n)
+@@ -461,6 +484,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine
}
#endif /* HAVE_SETUP */
@@ -81,7 +73,7 @@ index 62359c1..362d347 100644
if (m17n->table) {
g_object_unref (m17n->table);
m17n->table = NULL;
-@@ -844,6 +872,24 @@ ibus_m17n_engine_property_activate (IBusEngine *engine,
+@@ -778,6 +806,24 @@ ibus_m17n_engine_property_activate (IBus
}
#endif /* HAVE_SETUP */
@@ -106,6 +98,3 @@ index 62359c1..362d347 100644
parent_class->property_activate (engine, prop_name, prop_state);
}
---
-1.7.4
-
diff --git a/ibus-m17n-xkb-options.patch b/ibus-m17n-xkb-options.patch
new file mode 100644
index 0000000..551f1c8
--- /dev/null
+++ b/ibus-m17n-xkb-options.patch
@@ -0,0 +1,386 @@
+Patch to set certain XKB options when an m17n IME is set.
+Index: ibus-m17n-1.3.2/configure.ac
+===================================================================
+--- ibus-m17n-1.3.2.orig/configure.ac
++++ ibus-m17n-1.3.2/configure.ac
+@@ -106,6 +106,14 @@ AC_CHECK_FUNCS([ibus_engine_get_surround
+ CFLAGS="$save_CFLAGS"
+ LIBS="$save_LIBS"
+
++# check libxklavier
++have_libxklavier=no
++PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier gdk-3.0 x11],
++ have_libxklavier=yes)
++if test x$have_libxklavier != xno; then
++ AC_DEFINE([HAVE_LIBXKLAVIER], [1], [Define if libxklavier is found])
++fi
++
+ # define GETTEXT_* variables
+ GETTEXT_PACKAGE=ibus-m17n
+ AC_SUBST(GETTEXT_PACKAGE)
+Index: ibus-m17n-1.3.2/src/Makefile.am
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/Makefile.am
++++ ibus-m17n-1.3.2/src/Makefile.am
+@@ -66,10 +66,15 @@ ibus_engine_m17n_SOURCES = \
+ engine.c \
+ engine.h \
+ $(NULL)
++ibus_engine_m17n_CFLAGS = \
++ @LIBXKLAVIER_CFLAGS@ \
++ $(AM_CFLAGS) \
++ $(NULL)
+ ibus_engine_m17n_LDADD = \
+ libm17ncommon.a \
+ @IBUS_LIBS@ \
+ @M17N_LIBS@ \
++ @LIBXKLAVIER_LIBS@ \
+ $(NULL)
+
+ if HAVE_GTK
+Index: ibus-m17n-1.3.2/src/default.xml.in.in
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/default.xml.in.in
++++ ibus-m17n-1.3.2/src/default.xml.in.in
+@@ -12,19 +12,22 @@
+ <preedit-highlight>FALSE</preedit-highlight>
+ </engine>
+ <engine>
+- <name>m17n:bn:inscript</name>
++ <name>m17n:bn:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+- <name>m17n:gu:inscript</name>
++ <name>m17n:gu:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+- <name>m17n:hi:inscript</name>
++ <name>m17n:hi:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:kn:kgp</name>
+@@ -37,19 +40,22 @@
+ <preedit-highlight>FALSE</preedit-highlight>
+ </engine>
+ <engine>
+- <name>m17n:mai:inscript</name>
++ <name>m17n:mai:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+- <name>m17n:ml:inscript</name>
++ <name>m17n:ml:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+- <name>m17n:mr:inscript</name>
++ <name>m17n:mr:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:ne:rom</name>
+@@ -57,14 +63,16 @@
+ <preedit-highlight>FALSE</preedit-highlight>
+ </engine>
+ <engine>
+- <name>m17n:or:inscript</name>
++ <name>m17n:or:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+- <name>m17n:pa:inscript</name>
++ <name>m17n:pa:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:sa:harvard-kyoto</name>
+@@ -72,14 +80,16 @@
+ <preedit-highlight>FALSE</preedit-highlight>
+ </engine>
+ <engine>
+- <name>m17n:sd:inscript</name>
++ <name>m17n:sd:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:si:wijesekera</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:ta:tamil99</name>
+@@ -87,9 +97,10 @@
+ <preedit-highlight>FALSE</preedit-highlight>
+ </engine>
+ <engine>
+- <name>m17n:te:inscript</name>
++ <name>m17n:te:inscript*</name>
+ <rank>2</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <!-- Samanala should have lower rank than other Sinhala
+ engines since it is the only non-keyboard input method in
+@@ -226,6 +237,7 @@
+ <name>m17n:si:*</name>
+ <rank>1</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ <xkb-options>lv3:ralt_switch</xkb-options>
+ </engine>
+ <engine>
+ <name>m17n:ta:*</name>
+Index: ibus-m17n-1.3.2/src/engine.c
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/engine.c
++++ ibus-m17n-1.3.2/src/engine.c
+@@ -6,6 +6,10 @@
+ #include <ibus.h>
+ #include <m17n.h>
+ #include <string.h>
++#ifdef HAVE_LIBXKLAVIER
++#include <gdk/gdkx.h>
++#include <libxklavier/xklavier.h>
++#endif /* HAVE_LIBXKLAVIER */
+ #include "m17nutil.h"
+ #include "engine.h"
+
+@@ -38,6 +42,10 @@ struct _IBusM17NEngineClass {
+ gboolean use_iok;
+
+ MInputMethod *im;
++
++#if HAVE_LIBXKLAVIER
++ XklConfigRec *xkl_config_rec;
++#endif /* HAVE_LIBXKLAVIER */
+ };
+
+ /* functions prototype */
+@@ -105,12 +113,90 @@ static IBusEngineClass *parent_class = N
+
+ static IBusConfig *config = NULL;
+
++#if HAVE_LIBXKLAVIER
++static XklEngine *xkl_engine = NULL;
++static XklConfigRec *xkl_system_config_rec = NULL;
++
++static gboolean
++parse_xkb_options (XklConfigRec *config_rec, const gchar *xkb_options)
++{
++ gchar **strv;
++
++ strv = g_strsplit (xkb_options, ",", -1);
++ if (g_strv_length (strv) < 1) {
++ g_strfreev (strv);
++ return FALSE;
++ }
++
++ g_strfreev (config_rec->options);
++ config_rec->options = strv;
++
++ return TRUE;
++}
++
++static GdkFilterReturn
++filter_xkl_event (GdkXEvent *xev,
++ GdkEvent *event,
++ gpointer user_data)
++{
++ XEvent *xevent = (XEvent *)xev;
++
++ xkl_engine_filter_events (xkl_engine, xevent);
++ return GDK_FILTER_CONTINUE;
++}
++
++static void
++on_xkl_config_changed (XklEngine *xklengine,
++ gpointer user_data)
++{
++ IBusM17NEngineClass *klass = user_data;
++ XklConfigRec *config_rec;
++
++ config_rec = xkl_config_rec_new ();
++ if (!xkl_config_rec_get_from_server (config_rec, xkl_engine)) {
++ g_object_unref (config_rec);
++ g_warning ("Can't get default keyboard config from the server");
++ } else if (klass->xkl_config_rec &&
++ !xkl_config_rec_equals (config_rec, klass->xkl_config_rec)) {
++ if (xkl_system_config_rec)
++ g_object_unref (xkl_system_config_rec);
++ xkl_system_config_rec = config_rec;
++ }
++}
++#endif /* HAVE_LIBXKLAVIER */
++
+ void
+ ibus_m17n_init (IBusBus *bus)
+ {
++#if HAVE_LIBXKLAVIER
++ if (gdk_init_check (NULL, NULL)) {
++ GdkDisplay *display = gdk_display_get_default ();
++ g_assert (display);
++
++ xkl_engine = xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY (display));
++ xkl_system_config_rec = xkl_config_rec_new ();
++ if (!xkl_config_rec_get_from_server (xkl_system_config_rec,
++ xkl_engine)) {
++ g_object_unref (xkl_system_config_rec);
++ xkl_system_config_rec = NULL;
++
++ g_warning ("Can't get default keyboard config from the server");
++ } else {
++ gdk_window_add_filter (NULL,
++ (GdkFilterFunc) filter_xkl_event,
++ NULL);
++ gdk_window_add_filter (gdk_get_default_root_window (),
++ (GdkFilterFunc) filter_xkl_event,
++ NULL);
++ xkl_engine_start_listen (xkl_engine, XKLL_TRACK_KEYBOARD_STATE);
++ }
++ }
++#endif /* HAVE_LIBXKLAVIER */
++
+ config = ibus_bus_get_config (bus);
+ if (config)
+ g_object_ref_sink (config);
++
+ ibus_m17n_init_common ();
+ }
+
+@@ -299,6 +385,25 @@ ibus_m17n_engine_class_init (IBusM17NEng
+ G_CALLBACK(ibus_m17n_config_value_changed),
+ klass);
+
++#if HAVE_LIBXKLAVIER
++ if (engine_config->xkb_options) {
++ klass->xkl_config_rec = xkl_config_rec_new ();
++ if (!xkl_config_rec_get_from_server (klass->xkl_config_rec,
++ xkl_engine)) {
++ g_object_unref (klass->xkl_config_rec);
++ g_warning ("Can't get default keyboard config from the server");
++ } else if (!parse_xkb_options (klass->xkl_config_rec,
++ engine_config->xkb_options)) {
++ g_object_unref (klass->xkl_config_rec);
++ g_warning ("Can't parse xkb options %s",
++ engine_config->xkb_options);
++ }
++ }
++
++ g_signal_connect (xkl_engine, "X-config-changed",
++ G_CALLBACK(on_xkl_config_changed), klass);
++#endif /* HAVE_LIBXKLAVIER */
++
+ klass->im = NULL;
+ }
+
+@@ -412,6 +517,9 @@ ibus_m17n_engine_constructor (GType
+ IBusM17NEngine *m17n;
+ GObjectClass *object_class;
+ IBusM17NEngineClass *klass;
++#if HAVE_LIBXKLAVIER
++ GdkDisplay *display;
++#endif /* HAVE_LIBXKLAVIER */
+
+ m17n = (IBusM17NEngine *) G_OBJECT_CLASS (parent_class)->constructor (type,
+ n_construct_params,
+@@ -499,6 +607,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine
+ m17n->context = NULL;
+ }
+
++#if HAVE_LIBXKLAVIER
++ if (xkl_system_config_rec)
++ xkl_config_rec_activate (xkl_system_config_rec, xkl_engine);
++#endif /* HAVE_LIBXKLAVIER */
++
+ IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)m17n);
+ }
+
+@@ -735,6 +848,19 @@ ibus_m17n_engine_enable (IBusEngine *eng
+ ibus_engine_get_surrounding_text (engine, &text, &cursor_pos);
+ g_object_unref (text);
+ #endif /* HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT */
++
++#if HAVE_LIBXKLAVIER
++ GObjectClass *object_class;
++ IBusM17NEngineClass *klass;
++
++ object_class = G_OBJECT_GET_CLASS (m17n);
++ klass = (IBusM17NEngineClass *) object_class;
++
++ if (klass->xkl_config_rec) {
++ if (!xkl_config_rec_activate (klass->xkl_config_rec, xkl_engine))
++ g_warning ("Can't set the XKB layout");
++ }
++#endif /* HAVE_LIBXKLAVIER */
+ }
+
+ static void
+@@ -744,6 +870,17 @@ ibus_m17n_engine_disable (IBusEngine *en
+
+ ibus_m17n_engine_focus_out (engine);
+ parent_class->disable (engine);
++
++#if HAVE_LIBXKLAVIER
++ GObjectClass *object_class;
++ IBusM17NEngineClass *klass;
++
++ object_class = G_OBJECT_GET_CLASS (m17n);
++ klass = (IBusM17NEngineClass *) object_class;
++
++ if (xkl_system_config_rec)
++ xkl_config_rec_activate (xkl_system_config_rec, xkl_engine);
++#endif /* HAVE_LIBXKLAVIER */
+ }
+
+ static void
+Index: ibus-m17n-1.3.2/src/m17nutil.c
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/m17nutil.c
++++ ibus-m17n-1.3.2/src/m17nutil.c
+@@ -290,6 +290,11 @@ ibus_m17n_engine_config_parse_xml_node (
+ sub_node->name, sub_node->text);
+ continue;
+ }
++ if (g_strcmp0 (sub_node->name, "xkb-options") == 0) {
++ g_free (cnode->config.xkb_options);
++ cnode->config.xkb_options = g_strdup (sub_node->text);
++ continue;
++ }
+ g_warning ("<engine> element contains invalid element <%s>",
+ sub_node->name);
+ }
+Index: ibus-m17n-1.3.2/src/m17nutil.h
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/m17nutil.h
++++ ibus-m17n-1.3.2/src/m17nutil.h
+@@ -16,6 +16,9 @@ struct _IBusM17NEngineConfig {
+
+ /* whether to highlight preedit */
+ gboolean preedit_highlight;
++
++ /* keyboard options to which the engine switches when enabled */
++ char *xkb_options;
+ };
+
+ typedef struct _IBusM17NEngineConfig IBusM17NEngineConfig;
diff --git a/ibus-m17n-xx-icon-symbol.patch b/ibus-m17n-xx-icon-symbol.patch
new file mode 100644
index 0000000..43dac05
--- /dev/null
+++ b/ibus-m17n-xx-icon-symbol.patch
@@ -0,0 +1,130 @@
+Patch to embed hotkeys and symbol property in component XML.
+Index: ibus-m17n-1.3.2/configure.ac
+===================================================================
+--- ibus-m17n-1.3.2.orig/configure.ac
++++ ibus-m17n-1.3.2/configure.ac
+@@ -122,6 +122,10 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GET
+ AM_GNU_GETTEXT([external])
+ AM_GNU_GETTEXT_VERSION(0.16.1)
+
++# hotkeys in component xml
++IBUS_WITH_HOTKEYS
++IBUS_SET_SYMBOL([?])
++
+
+ # OUTPUT files
+ AC_CONFIG_FILES([ po/Makefile.in
+Index: ibus-m17n-1.3.2/m4/ibus.m4
+===================================================================
+--- /dev/null
++++ ibus-m17n-1.3.2/m4/ibus.m4
+@@ -0,0 +1,52 @@
++# IBUS_WITH_HOTKEYS([DEFAULT])
++AC_DEFUN([IBUS_WITH_HOTKEYS], [
++ IBUS_HOTKEYS_DEFAULT=m4_default([$1], [Control+space,Zenkaku_Hankaku])
++ AC_ARG_WITH(hotkeys,
++ [AC_HELP_STRING([--with-hotkeys=HOTKEYS],
++ [Use hotkeys for ibus bridge mode. (available value: yes/no/keys)])],
++ [with_hotkeys="$withval"],
++ [with_hotkeys="no"])
++ if test x$with_hotkeys = xno; then
++ IBUS_HOTKEYS_XML="<!-- <hotkeys>${IBUS_HOTKEYS_DEFAULT}</hotkeys> -->"
++ elif test x$with_hotkeys = xyes -o x$with_hotkeys = x; then
++ IBUS_HOTKEYS="$IBUS_HOTKEYS_DEFAULT"
++ IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</hotkeys>"
++ else
++ IBUS_HOTKEYS="$with_hotkeys"
++ IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</hotkeys>"
++ fi
++ if test x$IBUS_HOTKEYS != x; then
++ AC_DEFINE_UNQUOTED(IBUS_IBUS_HOTKEYS, ["$IBUS_HOTKEYS"],
++ [IME specific hotkeys for IBus])
++ AC_SUBST(IBUS_HOTKEYS)
++ fi
++ AC_SUBST(IBUS_HOTKEYS_XML)
++])
++
++# IBUS_SET_SYMBOL(SYMBOL)
++AC_DEFUN([IBUS_SET_SYMBOL], [
++ IBUS_SYMBOL="$1"
++ if test x$PYTHON = x; then
++ AM_PATH_PYTHON([2.5])
++ fi
++ AC_MSG_CHECKING([if ibus supports icon symbol])
++ $PYTHON <<_IBUS_SYMBOL_TEST
++import ibus
++engine = ibus.EngineDesc('test')
++exit(not hasattr(engine, 'symbol'))
++_IBUS_SYMBOL_TEST
++ if test $? -eq 0; then
++ IBUS_SYMBOL_XML="<symbol>${IBUS_SYMBOL}</symbol>"
++ AC_MSG_RESULT([yes])
++ else
++ IBUS_SYMBOL_XML="<!-- <symbol>${IBUS_SYMBOL}</symbol> -->"
++ IBUS_SYMBOL=
++ AC_MSG_RESULT([no])
++ fi
++ if test x$IBUS_SYMBOL != x; then
++ AC_DEFINE_UNQUOTED([IBUS_SYMBOL], ["$IBUS_SYMBOL"],
++ [Icon symbol string for IBus])
++ AC_SUBST(IBUS_SYMBOL)
++ fi
++ AC_SUBST(IBUS_SYMBOL_XML)
++])
+Index: ibus-m17n-1.3.2/src/default.xml.in.in
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/default.xml.in.in
++++ ibus-m17n-1.3.2/src/default.xml.in.in
+@@ -254,5 +254,7 @@
+ <name>m17n:*</name>
+ <rank>0</rank>
+ <preedit-highlight>FALSE</preedit-highlight>
++ @IBUS_HOTKEYS_XML@
++ @IBUS_SYMBOL_XML@
+ </engine>
+ </engines>
+Index: ibus-m17n-1.3.2/src/m17nutil.c
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/m17nutil.c
++++ ibus-m17n-1.3.2/src/m17nutil.c
+@@ -122,6 +122,8 @@ ibus_m17n_engine_new (MSymbol lang,
+ "icon", engine_icon ? engine_icon : "",
+ "layout", "us",
+ "rank", config->rank,
++ "hotkeys", config->hotkeys ? config->hotkeys : "",
++ "symbol", config->symbol ? config->symbol : "",
+ NULL);
+ #else
+ engine = ibus_engine_desc_new (engine_name,
+@@ -282,6 +284,14 @@ ibus_m17n_engine_config_parse_xml_node (
+ cnode->config.rank = atoi (sub_node->text);
+ continue;
+ }
++ if (g_strcmp0 (sub_node->name , "hotkeys") == 0) {
++ cnode->config.hotkeys = g_strdup (sub_node->text);
++ continue;
++ }
++ if (g_strcmp0 (sub_node->name , "symbol") == 0) {
++ cnode->config.symbol = g_strdup (sub_node->text);
++ continue;
++ }
+ if (g_strcmp0 (sub_node->name , "preedit-highlight") == 0) {
+ if (g_ascii_strcasecmp ("TRUE", sub_node->text) == 0)
+ cnode->config.preedit_highlight = TRUE;
+Index: ibus-m17n-1.3.2/src/m17nutil.h
+===================================================================
+--- ibus-m17n-1.3.2.orig/src/m17nutil.h
++++ ibus-m17n-1.3.2/src/m17nutil.h
+@@ -14,6 +14,12 @@ struct _IBusM17NEngineConfig {
+ /* engine rank */
+ gint rank;
+
++ /* hotkeys */
++ gchar *hotkeys;
++
++ /* symbol */
++ gchar *symbol;
++
+ /* whether to highlight preedit */
+ gboolean preedit_highlight;
+
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index 89ed649..aa1103c 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -1,20 +1,31 @@
-%define require_ibus_version 1.3.0
+%global require_ibus_version 1.3.0
+%global have_bridge_hotkey 0
+
+%if (0%{?fedora} > 14)
+%global _with_gtk --with-gtk=3.0
+%else
+%global _with_gtk --with-gtk=2.0
+%endif
+
+%if %have_bridge_hotkey
+%global _with_hotkeys --with-hotkeys
+%endif
Name: ibus-m17n
Version: 1.3.2
-Release: 5%{?dist}
+Release: 7%{?dist}
Summary: The M17N engine for IBus platform
License: GPLv2+
Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
+# dummy source to keep quilt series file
+Source1: series
-Patch0: ibus-m17n-iok.patch
-Patch1: ibus-m17n-HEAD.patch
-# Surrounding-text support fixes. Hopefully Patch2 won't be needed
-# with future IBus versions.
-Patch2: ibus-m17n-stscap.patch
-Patch3: ibus-m17n-stsreq.patch
+Patch0: ibus-m17n-HEAD.patch
+Patch1: ibus-m17n-iok.patch
+Patch2: ibus-m17n-xkb-options.patch
+Patch3: ibus-m17n-xx-icon-symbol.patch
# The following BR is for autogen and not necessary when packging
# released tarballs.
@@ -23,7 +34,12 @@ BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: gnome-common
BuildRequires: m17n-lib-devel
+%if (0%{?fedora} > 14)
BuildRequires: gtk3-devel
+%else
+BuildRequires: gtk2-devel
+%endif
+BuildRequires: libxklavier-devel
BuildRequires: ibus-devel >= %{require_ibus_version}
Requires: ibus >= %{require_ibus_version}
@@ -36,14 +52,14 @@ the input table maps from m17n-db.
%prep
%setup -q
-%patch0 -p1 -b .iok
-%patch1 -p1 -b .HEAD
-%patch2 -p1 -b .stscap
-%patch3 -p1 -b .stsreq
+%patch0 -p1 -b .HEAD
+%patch1 -p1 -b .iok
+%patch2 -p1 -b .xkb-options
+%patch3 -p1 -b .xx-icon-symbol
NOCONFIGURE=1 ./autogen.sh
%build
-%configure --disable-static --with-gtk=3.0
+%configure --disable-static %{?_with_gtk} %{?_with_hotkeys}
# make -C po update-gmo
make %{?_smp_mflags}
@@ -61,6 +77,14 @@ make DESTDIR=${RPM_BUILD_ROOT} install
%{_datadir}/ibus/component/*
%changelog
+* Thu Jul 7 2011 Daiki Ueno <dueno at redhat.com> - 1.3.2-7
+- don't specify --with-hotkey.
+
+* Mon Jul 4 2011 Daiki Ueno <dueno at redhat.com> - 1.3.2-6
+- Add ibus-m17n-xkb-options.patch.
+- Add ibus-m17n-xx-icon-symbol.patch.
+- Drop surrounding-text patches since they are included in the HEAD patch.
+
* Wed Jun 15 2011 Daiki Ueno <dueno at redhat.com> - 1.3.2-5
- Add ibus-m17n-stsreq.patch.
- Fix bug 711126 - ibus: surrounding text support fails for the first
diff --git a/series b/series
new file mode 100644
index 0000000..d44fc01
--- /dev/null
+++ b/series
@@ -0,0 +1,4 @@
+ibus-m17n-HEAD.patch
+ibus-m17n-iok.patch
+ibus-m17n-xkb-options.patch
+ibus-m17n-xx-icon-symbol.patch
More information about the i18n-bugs
mailing list