[ibus-m17n/f14/master] Update to 1.3.1-2.

Daiki Ueno ueno at fedoraproject.org
Thu Sep 16 03:54:04 UTC 2010


commit d5f78f6248cf6baed8fd60167035b337551817e7
Author: Daiki Ueno <ueno at unixuser.org>
Date:   Thu Sep 16 12:56:11 2010 +0900

    Update to 1.3.1-2.

 ibus-m17n-surrounding-text.patch |   72 ++++++++++++++++++++++++++++++++++++++
 ibus-m17n.spec                   |    7 +++-
 2 files changed, 78 insertions(+), 1 deletions(-)
---
diff --git a/ibus-m17n-surrounding-text.patch b/ibus-m17n-surrounding-text.patch
new file mode 100644
index 0000000..e9d8f63
--- /dev/null
+++ b/ibus-m17n-surrounding-text.patch
@@ -0,0 +1,72 @@
+From d99ee4e1045346ab881525eb681abcf387d9b4cc Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno at unixuser.org>
+Date: Wed, 15 Sep 2010 12:21:35 +0900
+Subject: [PATCH] Support surrounding-text commands.
+
+---
+ src/engine.c |   50 +++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 47 insertions(+), 3 deletions(-)
+
+diff --git a/src/engine.c b/src/engine.c
+index 260a806..f81b9ec 100644
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -812,8 +812,52 @@ ibus_m17n_engine_callback (MInputContext *context,
+     }
+     else if (command == Minput_reset) {
+     }
+-    else if (command == Minput_get_surrounding_text) {
+-    }
+-    else if (command == Minput_delete_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;
++
++        len = (long) mplist_value (m17n->context->plist);
++        mt = mconv_decode_buffer (Mcoding_utf_8, text->text, nbytes);
++        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 &&
++             (((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);
+     }
+ }
+-- 
+1.7.2.2
+
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index 303b285..b79b958 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -2,7 +2,7 @@
 
 Name:       ibus-m17n
 Version:    1.3.1
-Release:    1%{?dist}
+Release:    2%{?dist}
 Summary:    The M17N engine for IBus platform
 License:    GPLv2+
 Group:      System Environment/Libraries
@@ -10,6 +10,7 @@ URL:        http://code.google.com/p/ibus/
 Source0:    http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
 
 Patch0:     ibus-m17n-iok.patch
+Patch1:	    ibus-m17n-surrounding-text.patch
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  gettext-devel
@@ -30,6 +31,7 @@ the input table maps from m17n-db.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure --disable-static
@@ -54,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/ibus/component/*
 
 %changelog
+* Thu Sep 16 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-2
+- Apply surrounding text patch.  Bug 435880.
+
 * Fri Sep  3 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-1
 - Update to 1.3.1.
 - Fix bug 615158 - Do not change the background colour of the pre-edit buffer


More information about the scm-commits mailing list