[ibus-m17n/f13/master] Update to 1.3.1-5.

Daiki Ueno ueno at fedoraproject.org
Thu Oct 14 03:59:22 UTC 2010


commit 1615e09b0fef47aa7489906e04a9a3a2abea4a8a
Author: Daiki Ueno <ueno at unixuser.org>
Date:   Thu Oct 14 13:02:34 2010 +0900

    Update to 1.3.1-5.

 ibus-m17n-fedora.patch           |  207 ++++++++++++++++++++++++++++++++++++++
 ibus-m17n-surrounding-text.patch |   73 +++++++++++++
 ibus-m17n.spec                   |   24 ++++-
 3 files changed, 303 insertions(+), 1 deletions(-)
---
diff --git a/ibus-m17n-fedora.patch b/ibus-m17n-fedora.patch
new file mode 100644
index 0000000..52db0d9
--- /dev/null
+++ b/ibus-m17n-fedora.patch
@@ -0,0 +1,207 @@
+diff --git a/src/engine.c b/src/engine.c
+index dbd00fc..1dbcf34 100644
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -424,9 +424,9 @@ ibus_m17n_engine_commit_string (IBusM17NEngine *m17n,
+     ibus_m17n_engine_update_preedit (m17n);
+ }
+ 
+-/* Note on AltGr handling: While currently we expect AltGr == mod5, it
+-   would be better to not expect the modifier always be assigned
+-   to particular modX.  However, it needs some code like:
++/* Note on AltGr (Level3 Shift) handling: While currently we expect
++   AltGr == mod5, it would be better to not expect the modifier always
++   be assigned to particular modX.  However, it needs some code like:
+ 
+    KeyCode altgr = XKeysymToKeycode (display, XK_ISO_Level3_Shift);
+    XModifierKeymap *mods = XGetModifierMapping (display);
+@@ -448,20 +448,26 @@ ibus_m17n_key_event_to_symbol (guint keycode,
+     MSymbol mkeysym = Mnil;
+     guint mask = 0;
+     IBusKeymap *keymap;
+-    guint base_keyval;
+ 
+     if (keyval >= IBUS_Shift_L && keyval <= IBUS_Hyper_R) {
+         return Mnil;
+     }
+ 
+-    keymap = ibus_keymap_get ("us");
+-    base_keyval = ibus_keymap_lookup_keysym (keymap, keycode, 0);
+-    g_object_unref (keymap);
++    /* Here, keyval is already translated by IBUS_MOD5_MASK.  Obtain
++       the untranslated keyval from the underlying keymap and
++       represent the translated keyval as the form "G-<untranslated
++       keyval>", which m17n-lib accepts. */
++    if (modifiers & IBUS_MOD5_MASK) {
++        keymap = ibus_keymap_get ("us");
++        keyval = ibus_keymap_lookup_keysym (keymap, keycode,
++                                            modifiers & ~IBUS_MOD5_MASK);
++        g_object_unref (keymap);
++    }
+ 
+     keysym = g_string_new ("");
+ 
+-    if (base_keyval >= IBUS_space && base_keyval <= IBUS_asciitilde) {
+-        gint c = (modifiers & IBUS_MOD5_MASK) ? base_keyval : keyval;
++    if (keyval >= IBUS_space && keyval <= IBUS_asciitilde) {
++        gint c = keyval;
+ 
+         if (keyval == IBUS_space && modifiers & IBUS_SHIFT_MASK)
+             mask |= IBUS_SHIFT_MASK;
+diff --git a/src/m17nutil.c b/src/m17nutil.c
+index ae0fe56..22b9fe1 100644
+--- a/src/m17nutil.c
++++ b/src/m17nutil.c
+@@ -7,37 +7,60 @@
+ 
+ static MConverter *utf8_converter = NULL;
+ 
+-static const gchar *keymap[] = {
+-    "m17n:as:phonetic",
+-    "m17n:bn:inscript",
+-    "m17n:gu:inscript",
+-    "m17n:hi:inscript",
+-    "m17n:kn:kgp",
+-    "m17n:ks:kbd",
+-    "m17n:mai:inscript",
+-    "m17n:ml:inscript",
+-    "m17n:mr:inscript",
+-    "m17n:ne:rom",
+-    "m17n:or:inscript",
+-    "m17n:pa:inscript",
+-    "m17n:sa:harvard-kyoto",
+-    "m17n:sd:inscript",
+-    "m17n:si:wijesekera",
+-    "m17n:ta:tamil99",
+-    "m17n:te:inscript"
+-};
+-
+-static const gchar *preedit_highlight[] = {
+-    "m17n:ja:anthy",
+-    "m17n:zh:cangjie",
+-    "m17n:zh:py-b5",
+-    "m17n:zh:py-gb",
+-    "m17n:zh:py",
+-    "m17n:zh:quick",
+-    "m17n:zh:tonepy-b5",
+-    "m17n:zh:tonepy-gb",
+-    "m17n:zh:tonepy",
+-    "m17n:zh:util",
++static const struct {
++    const gchar *name;
++    gint rank;                  /* engine rank (default 0) */
++    gboolean preedit_highlight; /* whether to highlight preedit (default 0) */
++} engine_config[] = {
++    /* Indic engines which represent languages. */
++    {"m17n:as:phonetic", 2, FALSE},
++    {"m17n:bn:inscript", 2, FALSE},
++    {"m17n:gu:inscript", 2, FALSE},
++    {"m17n:hi:inscript", 2, FALSE},
++    {"m17n:kn:kgp", 2, FALSE},
++    {"m17n:ks:kbd", 2, FALSE},
++    {"m17n:mai:inscript", 2, FALSE},
++    {"m17n:ml:inscript", 2, FALSE},
++    {"m17n:mr:inscript", 2, FALSE},
++    {"m17n:ne:rom", 2, FALSE},
++    {"m17n:or:inscript", 2, FALSE},
++    {"m17n:pa:inscript", 2, FALSE},
++    {"m17n:sa:harvard-kyoto", 2, FALSE},
++    {"m17n:sd:inscript", 2, FALSE},
++    {"m17n:si:wijesekera", 2, FALSE},
++    {"m17n:ta:tamil99", 2, FALSE},
++    {"m17n:te:inscript", 2, FALSE},
++    /* Other Indic engines should be selected by default:
++       https://bugzilla.redhat.com/show_bug.cgi?id=640896
++     */
++    {"m17n:as:*", 1, FALSE},
++    {"m17n:bn:*", 1, FALSE},
++    {"m17n:gu:*", 1, FALSE},
++    {"m17n:hi:*", 1, FALSE},
++    {"m17n:kn:*", 1, FALSE},
++    {"m17n:ks:*", 1, FALSE},
++    {"m17n:mai:*", 1, FALSE},
++    {"m17n:ml:*", 1, FALSE},
++    {"m17n:mr:*", 1, FALSE},
++    {"m17n:ne:*", 1, FALSE},
++    {"m17n:or:*", 1, FALSE},
++    {"m17n:pa:*", 1, FALSE},
++    {"m17n:sa:*", 1, FALSE},
++    {"m17n:sd:*", 1, FALSE},
++    {"m17n:si:*", 1, FALSE},
++    {"m17n:ta:*", 1, FALSE},
++    {"m17n:te:*", 1, FALSE},
++    /* Chinese and Japanese engines which require preedit decoration. */
++    {"m17n:ja:anthy", 0, TRUE},
++    {"m17n:zh:cangjie", 0, TRUE},
++    {"m17n:zh:py-b5", 0, TRUE},
++    {"m17n:zh:py-gb", 0, TRUE},
++    {"m17n:zh:py", 0, TRUE},
++    {"m17n:zh:quick", 0, TRUE},
++    {"m17n:zh:tonepy-b5", 0, TRUE},
++    {"m17n:zh:tonepy-gb", 0, TRUE},
++    {"m17n:zh:tonepy", 0, TRUE},
++    {"m17n:zh:util", 0, TRUE}
+ };
+ 
+ void
+@@ -101,11 +124,16 @@ guint
+ ibus_m17n_parse_color (const gchar *hex)
+ {
+     guint color;
+-    if (hex && *hex == '#' &&
+-        ((color = strtoul (&hex[1], NULL, 16)) != ULONG_MAX ||
+-         errno != ERANGE))
+-        return color;
+-    return (guint)-1;
++
++    if (!hex || *hex != '#')
++        return (guint)-1;
++
++    errno = 0;
++    color = strtoul (&hex[1], NULL, 16);
++    if ((errno == ERANGE && color == ULONG_MAX)
++        || (errno != 0 && color == 0))
++        return (guint)-1;
++    return color;
+ }
+ 
+ static IBusEngineDesc *
+@@ -141,10 +169,10 @@ ibus_m17n_engine_new (MSymbol  lang,
+     /* set default rank to 0 */
+     engine->rank = 0;
+ 
+-    for (i = 0; i < G_N_ELEMENTS(keymap); i++) {
+-        if (strcmp (engine_name, keymap[i]) == 0) {
++    for (i = 0; i < G_N_ELEMENTS(engine_config); i++) {
++        if (g_pattern_match_simple (engine_config[i].name, engine_name)) {
+             /* set rank of default keymap to 1 */
+-            engine->rank = 1;
++            engine->rank = engine_config[i].rank;
+             break;
+         }
+     }
+@@ -271,9 +299,9 @@ ibus_m17n_preedit_highlight (const gchar *engine_name)
+ {
+     gint i;
+ 
+-    for (i = 0; i < G_N_ELEMENTS(preedit_highlight); i++) {
+-        if (strcmp (engine_name, preedit_highlight[i]) == 0)
+-            return TRUE;
++    for (i = 0; i < G_N_ELEMENTS(engine_config); i++) {
++        if (g_pattern_match_simple (engine_config[i].name, engine_name))
++            return engine_config[i].preedit_highlight;
+     }
+     return FALSE;
+ }
+diff --git a/src/setup.c b/src/setup.c
+index 7442159..0fe6e1b 100644
+--- a/src/setup.c
++++ b/src/setup.c
+@@ -83,6 +83,7 @@ parse_value (MPlist *plist, gchar *text)
+     if (mplist_key (plist) == Minteger) {
+         long val;
+ 
++        errno = 0;
+         val = strtol (text, NULL, 10);
+         if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
+             || (errno != 0 && val == 0))
diff --git a/ibus-m17n-surrounding-text.patch b/ibus-m17n-surrounding-text.patch
new file mode 100644
index 0000000..b1ed3fb
--- /dev/null
+++ b/ibus-m17n-surrounding-text.patch
@@ -0,0 +1,73 @@
+From 6bec9368e23e2637e81b7b6b56b02a88d5f2bbda 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 |   51 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 48 insertions(+), 3 deletions(-)
+
+diff --git a/src/engine.c b/src/engine.c
+index 260a806..73d6ef2 100644
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -812,8 +812,53 @@ 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;
++        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 &&
++             (((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.3
+
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index 303b285..58cba0b 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -2,7 +2,7 @@
 
 Name:       ibus-m17n
 Version:    1.3.1
-Release:    1%{?dist}
+Release:    5%{?dist}
 Summary:    The M17N engine for IBus platform
 License:    GPLv2+
 Group:      System Environment/Libraries
@@ -10,6 +10,8 @@ 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
+Patch2:	    ibus-m17n-fedora.patch
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  gettext-devel
@@ -30,6 +32,8 @@ the input table maps from m17n-db.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %configure --disable-static
@@ -54,6 +58,24 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/ibus/component/*
 
 %changelog
+* Tue Oct 12 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-5
+- put several Fedora patches into one.
+- Fix bug 640896 - Ibus does not load all the keymaps for a language
+  that is used for logging in.
+
+* Tue Oct  5 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-4
+- Remove Shift+AltGr patch; apply a simplified AltGr patch.
+- Fix bug 639963 - SHIFT switch is not working in layouts as expected.
+
+* Fri Oct  1 2010 Daiki Ueno <dueno at redhat.com> - 1.3.1-3
+- Apply a patch to handle Shift+AltGr.
+- Update surrounding-text patch.
+- Fix bug 634829 - [abrt] ibus-m17n-1.3.1-1.fc14: shift_state: Process
+  /usr/libexec/ibus-engine-m17n was killed by signal 11 (SIGSEGV).
+
+* 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