[Fedora-i18n-bugs] [ibus-m17n/f13/master] Update to 1.3.2-1.
Daiki Ueno
ueno at fedoraproject.org
Mon Mar 7 06:46:42 UTC 2011
commit 7a232789fdf58b126c062c2a9489466ef4a2415c
Author: Daiki Ueno <ueno at unixuser.org>
Date: Mon Mar 7 15:48:01 2011 +0900
Update to 1.3.2-1.
.gitignore | 1 +
ibus-m17n-HEAD.patch | 1486 --------------------------------------
ibus-m17n-iok.patch | 84 ++-
ibus-m17n-surrounding-text.patch | 99 +++
ibus-m17n.spec | 31 +-
sources | 2 +-
6 files changed, 164 insertions(+), 1539 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a2af7bc..6dce4bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
ibus-m17n-1.3.0.tar.gz
/ibus-m17n-1.3.1.tar.gz
+/ibus-m17n-1.3.2.tar.gz
diff --git a/ibus-m17n-iok.patch b/ibus-m17n-iok.patch
index c6e4ca2..df6ef43 100644
--- a/ibus-m17n-iok.patch
+++ b/ibus-m17n-iok.patch
@@ -1,46 +1,54 @@
-From 17e633c3e3cbfd1a240b95352167005a8396a7b2 Mon Sep 17 00:00:00 2001
+From c27a0917c26624f1741efeebe20cd5cfb8647a67 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno at unixuser.org>
-Date: Wed, 8 Dec 2010 18:06:11 +0900
-Subject: [PATCH] Apply iok patch from fedora.
+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 f8e7fe5..ff8bbfc 100644
+index 62359c1..362d347 100644
--- a/src/engine.c
+++ b/src/engine.c
-@@ -35,6 +35,7 @@ struct _IBusM17NEngine {
- IBusProperty *status_prop;
+@@ -37,6 +37,7 @@ struct _IBusM17NEngine {
IBusProperty *setup_prop;
+ #endif /* HAVE_SETUP */
IBusPropList *prop_list;
+ IBusProperty *show_iok_prop;
};
struct _IBusM17NEngineClass {
-@@ -411,6 +412,8 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+@@ -48,6 +49,7 @@ struct _IBusM17NEngineClass {
+ guint preedit_background;
+ gint preedit_underline;
+ gint lookup_table_orientation;
++ gboolean use_iok;
+
+ MInputMethod *im;
+ };
+@@ -316,6 +318,9 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass)
+ }
+ engine_name = g_strdup_printf ("m17n:%s:%s", lang, name);
+ klass->config_section = g_strdup_printf ("engine/M17N/%s/%s", lang, name);
++ /* whether to use iok - maybe good to move this to default.xml */
++ klass->use_iok = g_strcmp0 (name, "inscript") == 0 ||
++ g_strcmp0 (name, "inscript2") == 0;
+ g_free (lang);
+ g_free (name);
+
+@@ -420,6 +425,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
{
IBusText* label;
IBusText* tooltip;
-+ const gchar *engine_name;
-+ gchar *lang = NULL, *name = NULL;
++ IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
- m17n->status_prop = ibus_property_new ("status",
- PROP_TYPE_NORMAL,
-@@ -436,10 +439,32 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
- NULL);
- g_object_ref_sink (m17n->setup_prop);
+ m17n->prop_list = ibus_prop_list_new ();
+ g_object_ref_sink (m17n->prop_list);
+@@ -452,6 +458,23 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+ ibus_prop_list_append (m17n->prop_list, m17n->setup_prop);
+ #endif /* HAVE_SETUP */
-+ /* show iok icon for inscript - should be go in default.xml? */
-+ engine_name = ibus_engine_get_name ((IBusEngine *) m17n);
-+ if (ibus_m17n_scan_engine_name (engine_name, &lang, &name) &&
-+ (g_strcmp0 (name, "inscript") == 0 ||
-+ g_strcmp0 (name, "inscript2") == 0))
-+ ibus_property_set_visible (m17n->show_iok_prop, TRUE);
-+ g_free (lang);
-+ g_free (name);
-+
+ label = ibus_text_new_from_string ("iok");
+ m17n->show_iok_prop = ibus_property_new ("iok",
+ PROP_TYPE_NORMAL,
@@ -53,17 +61,17 @@ index f8e7fe5..ff8bbfc 100644
+ NULL);
+ g_object_ref_sink (m17n->show_iok_prop);
+
- m17n->prop_list = ibus_prop_list_new ();
- g_object_ref_sink (m17n->prop_list);
- ibus_prop_list_append (m17n->prop_list, m17n->status_prop);
- ibus_prop_list_append (m17n->prop_list, m17n->setup_prop);
++ if (klass->use_iok)
++ ibus_property_set_visible (m17n->show_iok_prop, TRUE);
++
+ ibus_prop_list_append (m17n->prop_list, m17n->show_iok_prop);
-
++
m17n->table = ibus_lookup_table_new (9, 0, TRUE, TRUE);
g_object_ref_sink (m17n->table);
-@@ -524,6 +549,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n)
- m17n->setup_prop = NULL;
+ m17n->context = NULL;
+@@ -537,6 +560,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n)
}
+ #endif /* HAVE_SETUP */
+ if (m17n->show_iok_prop) {
+ g_object_unref (m17n->show_iok_prop);
@@ -73,11 +81,11 @@ index f8e7fe5..ff8bbfc 100644
if (m17n->table) {
g_object_unref (m17n->table);
m17n->table = NULL;
-@@ -827,6 +857,22 @@ ibus_m17n_engine_property_activate (IBusEngine *engine,
- LIBEXECDIR, engine_name);
- g_spawn_command_line_async (setup, NULL);
- g_free (setup);
-+ } else if (g_strcmp0 (prop_name, "iok") == 0) {
+@@ -844,6 +872,24 @@ ibus_m17n_engine_property_activate (IBusEngine *engine,
+ }
+ #endif /* HAVE_SETUP */
+
++ if (g_strcmp0 (prop_name, "iok") == 0) {
+ const gchar *engine_name;
+ gchar *lang = NULL, *name = NULL;
+
@@ -93,9 +101,11 @@ index f8e7fe5..ff8bbfc 100644
+ }
+ g_free (lang);
+ g_free (name);
- }
++ }
++
parent_class->property_activate (engine, prop_name, prop_state);
}
+
--
-1.7.3.3
+1.7.4
diff --git a/ibus-m17n-surrounding-text.patch b/ibus-m17n-surrounding-text.patch
new file mode 100644
index 0000000..37c90c5
--- /dev/null
+++ b/ibus-m17n-surrounding-text.patch
@@ -0,0 +1,99 @@
+From 589f9dc5998dc5ea620d1e6fa1a64045574b1dc1 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno at unixuser.org>
+Date: Mon, 7 Mar 2011 15:06:38 +0900
+Subject: [PATCH] Support surrounding-text commands.
+
+---
+ src/engine.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
+ src/m17nutil.c | 8 ++++++++
+ 2 files changed, 55 insertions(+), 2 deletions(-)
+
+diff --git a/src/engine.c b/src/engine.c
+index 62359c1..ebe7ccc 100644
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -986,8 +986,53 @@ ibus_m17n_engine_callback (MInputContext *context,
+ }
+ else if (command == Minput_reset) {
+ }
+- else if (command == Minput_get_surrounding_text) {
++ else if (command == Minput_get_surrounding_text &&
++ (((IBusEngine *) m17n)->client_capabilities &
++ IBUS_CAP_SURROUNDING_TEXT) != 0) {
++ IBusText *text;
++ guint cursor_pos, nchars, nbytes;
++ MText *mt, *surround;
++ int len, pos;
++
++ ibus_engine_get_surrounding_text ((IBusEngine *) m17n,
++ &text,
++ &cursor_pos);
++ nchars = ibus_text_get_length (text);
++ nbytes = g_utf8_offset_to_pointer (text->text, nchars) - text->text;
++ mt = mconv_decode_buffer (Mcoding_utf_8, text->text, nbytes);
++ g_object_unref (text);
++
++ len = (long) mplist_value (m17n->context->plist);
++ if (len < 0) {
++ pos = cursor_pos + len;
++ if (pos < 0)
++ pos = 0;
++ surround = mtext_duplicate (mt, pos, cursor_pos);
++ }
++ else if (len > 0) {
++ pos = cursor_pos + len;
++ if (pos > nchars)
++ pos = nchars;
++ surround = mtext_duplicate (mt, cursor_pos, pos);
++ }
++ else {
++ surround = mtext ();
++ }
++ m17n_object_unref (mt);
++ mplist_set (m17n->context->plist, Mtext, surround);
++ m17n_object_unref (surround);
+ }
+- else if (command == Minput_delete_surrounding_text) {
++ else if (command == Minput_delete_surrounding_text &&
++ (((IBusEngine *) m17n)->client_capabilities &
++ IBUS_CAP_SURROUNDING_TEXT) != 0) {
++ int len;
++
++ len = (long) mplist_value (m17n->context->plist);
++ if (len < 0)
++ ibus_engine_delete_surrounding_text ((IBusEngine *) m17n,
++ len, -len);
++ else if (len > 0)
++ ibus_engine_delete_surrounding_text ((IBusEngine *) m17n,
++ 0, len);
+ }
+ }
+diff --git a/src/m17nutil.c b/src/m17nutil.c
+index 1150cc4..db99686 100644
+--- a/src/m17nutil.c
++++ b/src/m17nutil.c
+@@ -91,6 +91,13 @@ ibus_m17n_parse_color (const gchar *hex)
+ return color;
+ }
+
++#define DEFAULT_REQUIRES (IBUS_CAP_PREEDIT_TEXT | \
++ IBUS_CAP_AUXILIARY_TEXT | \
++ IBUS_CAP_LOOKUP_TABLE | \
++ IBUS_CAP_FOCUS | \
++ IBUS_CAP_PROPERTY | \
++ IBUS_CAP_SURROUNDING_TEXT)
++
+ static IBusEngineDesc *
+ ibus_m17n_engine_new (MSymbol lang,
+ MSymbol name,
+@@ -122,6 +129,7 @@ ibus_m17n_engine_new (MSymbol lang,
+ "icon", engine_icon ? engine_icon : "",
+ "layout", "us",
+ "rank", config->rank,
++ "requires", DEFAULT_REQUIRES,
+ NULL);
+ #else
+ engine = ibus_engine_desc_new (engine_name,
+--
+1.7.4
+
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index 6ff4bdf..9a9c397 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -1,26 +1,26 @@
%define require_ibus_version 1.3.0
Name: ibus-m17n
-Version: 1.3.1
-Release: 8%{?dist}
+Version: 1.3.2
+Release: 1%{?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
-Patch0: ibus-m17n-HEAD.patch
-Patch1: ibus-m17n-iok.patch
-# IBus surrounding-text support is not yet available in F-13.
-# Patch2: ibus-m17n-surrounding-text.patch
+Patch0: ibus-m17n-iok.patch
+Patch1: ibus-m17n-surrounding-text.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: gettext-devel
-BuildRequires: libtool
-BuildRequires: pkgconfig
+# The following BR is for autogen and not necessary when packging
+# released tarballs.
+# BuildRequires: gettext-devel
+# BuildRequires: libtool
+# BuildRequires: pkgconfig
+# BuildRequires: gnome-common
BuildRequires: m17n-lib-devel
BuildRequires: gtk2-devel
-BuildRequires: gnome-common
BuildRequires: ibus-devel >= %{require_ibus_version}
Requires: ibus >= %{require_ibus_version}
@@ -33,11 +33,9 @@ the input table maps from m17n-db.
%prep
%setup -q
-%patch0 -p1
-%patch1 -p1
-# IBus surrounding-text support is not yet available in F-13.
-# %patch2 -p1
-NOCONFIGURE=1 ./autogen.sh
+%patch0 -p1 -b .iok
+%patch1 -p1 -b .surrounding-text
+# NOCONFIGURE=1 ./autogen.sh
%build
%configure --disable-static
@@ -62,6 +60,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/ibus/component/*
%changelog
+* Mon Mar 7 2011 Daiki Ueno <dueno at redhat.com> - 1.3.2-1
+- New upstream release.
+
* Fri Dec 10 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-8
- Update ibus-m17n-HEAD.patch.
- Lower si-samanala.mim rank per request from a Sinhala user.
diff --git a/sources b/sources
index 3bc4b4a..c0a12ba 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-38ff41207518812945c60084deba0080 ibus-m17n-1.3.1.tar.gz
+4c406147318f94e5e805c408c4be075e ibus-m17n-1.3.2.tar.gz
More information about the i18n-bugs
mailing list