[ibus-m17n/f16] Update to 1.3.4-1.

Daiki Ueno ueno at fedoraproject.org
Fri May 11 07:30:31 UTC 2012


commit 06bce5874cacbe6623ac0914e7e755278cda64e9
Author: Daiki Ueno <ueno at unixuser.org>
Date:   Fri May 11 16:29:51 2012 +0900

    Update to 1.3.4-1.

 .gitignore                           |    1 +
 ibus-m17n-blacklist-engines.patch    |   31 +-
 ibus-m17n-custom-setup-element.patch |   49 --
 ibus-m17n-default-xml-override.patch |  621 -----------------------
 ibus-m17n-hide-title-status.patch    |   31 +-
 ibus-m17n-iok.patch                  |  102 ----
 ibus-m17n-setup-refactor.patch       |  843 -------------------------------
 ibus-m17n-virtkbd.patch              |  921 +++++++++++++---------------------
 ibus-m17n-xkb-options.patch          |   54 +-
 ibus-m17n-xx-icon-symbol.patch       |  390 --------------
 ibus-m17n.spec                       |   70 ++--
 sources                              |    2 +-
 12 files changed, 447 insertions(+), 2668 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 59fba23..4ccc028 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ ibus-m17n-1.3.0.tar.gz
 /ibus-m17n-1.3.1.tar.gz
 /ibus-m17n-1.3.2.tar.gz
 /ibus-m17n-1.3.3.tar.gz
+/ibus-m17n-1.3.4.tar.gz
diff --git a/ibus-m17n-blacklist-engines.patch b/ibus-m17n-blacklist-engines.patch
index cfa3a92..80c5425 100644
--- a/ibus-m17n-blacklist-engines.patch
+++ b/ibus-m17n-blacklist-engines.patch
@@ -1,19 +1,19 @@
-From 4a2f3279fb4fbeb8be66ff7bf40cce57e616d45b Mon Sep 17 00:00:00 2001
+From 5978feeb0d96d633417318daf29c3d4974e17b2d Mon Sep 17 00:00:00 2001
 From: Daiki Ueno <ueno at unixuser.org>
 Date: Tue, 25 Oct 2011 14:26:41 +0900
-Subject: [PATCH] Blacklist some engines useless under ibus environment.
+Subject: [PATCH 3/4] Blacklist some engines useless under ibus environment.
 
 ---
- src/default.xml.in.in |   32 ++++++++++++++++++++++++++++++++
- 1 files changed, 32 insertions(+), 0 deletions(-)
+ src/default.xml.in.in |   26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
 
-Index: ibus-m17n-1.3.3/src/default.xml.in.in
-===================================================================
---- ibus-m17n-1.3.3.orig/src/default.xml.in.in
-+++ ibus-m17n-1.3.3/src/default.xml.in.in
-@@ -14,6 +14,38 @@
- 		@IBUS_HOTKEYS_XML@
- 		<virtual-keyboard>us</virtual-keyboard>
+diff --git a/src/default.xml.in.in b/src/default.xml.in.in
+index beae494..fda4f30 100644
+--- a/src/default.xml.in.in
++++ b/src/default.xml.in.in
+@@ -12,6 +12,32 @@
+ 		<preedit-highlight>FALSE</preedit-highlight>
+ 		<symbol></symbol>
  	</engine>
 +	<!-- Blacklist some engines -->
 +	<!-- kbd engines are duplicate of xkb engines -->
@@ -21,12 +21,6 @@ Index: ibus-m17n-1.3.3/src/default.xml.in.in
 +		<name>m17n:*:kbd</name>
 +		<rank>-1</rank>
 +	</engine>
-+	<!-- zh:pinyin is considered as a toy, since it does not
-+	     support Han characters -->
-+	<engine>
-+		<name>m17n:zh:pinyin</name>
-+		<rank>-1</rank>
-+	</engine>
 +	<!-- zh:py is superseded by ibus-pinyin etc -->
 +	<engine>
 +		<name>m17n:zh:py</name>
@@ -50,3 +44,6 @@ Index: ibus-m17n-1.3.3/src/default.xml.in.in
  	<!-- Indic engines should be selected by default:
  	     https://bugzilla.redhat.com/show_bug.cgi?id=640896 -->
  	<engine>
+-- 
+1.7.7.6
+
diff --git a/ibus-m17n-hide-title-status.patch b/ibus-m17n-hide-title-status.patch
index 0d52c54..6326eba 100644
--- a/ibus-m17n-hide-title-status.patch
+++ b/ibus-m17n-hide-title-status.patch
@@ -1,25 +1,25 @@
-From d4a1cb9c6bd852da73ba6520fc5c14edbe84ec14 Mon Sep 17 00:00:00 2001
+From 02022c17212357afb5cec727edd8f095aa40d98d Mon Sep 17 00:00:00 2001
 From: Daiki Ueno <ueno at unixuser.org>
 Date: Thu, 29 Sep 2011 10:17:28 +0900
-Subject: [PATCH] Hide status from the panel if status == title.
+Subject: [PATCH 2/4] Hide status from the panel if status == title.
 
 ---
  src/engine.c |    8 +++++++-
  1 files changed, 7 insertions(+), 1 deletions(-)
 
-diff --git a/src/engine.c b/src/engine.c
-index f23d982..a0dcc70 100644
---- a/src/engine.c
-+++ b/src/engine.c
-@@ -43,6 +43,7 @@ struct _IBusM17NEngineClass {
-     gboolean virtual_keyboard_enabled;
-     gboolean use_iok;
+Index: ibus-m17n-1.3.4/src/engine.c
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/engine.c
++++ ibus-m17n-1.3.4/src/engine.c
+@@ -36,6 +36,7 @@ struct _IBusM17NEngineClass {
+     IBusPreeditFocusMode preedit_focus_mode;
+     gint lookup_table_orientation;
  
 +    gchar *title;
      MInputMethod *im;
  };
  
-@@ -256,6 +257,10 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass)
+@@ -245,6 +246,10 @@ 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);
@@ -27,10 +27,10 @@ index f23d982..a0dcc70 100644
 +    if (l && mplist_key (l) == Mtext) {
 +        klass->title = ibus_m17n_mtext_to_utf8 (mplist_value (l));
 +    }
-     /* 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;
-@@ -994,8 +999,9 @@ ibus_m17n_engine_callback (MInputContext *context,
+     g_free (lang);
+     g_free (name);
+ 
+@@ -903,8 +908,9 @@ ibus_m17n_engine_callback (MInputContext
      else if (command == Minput_status_draw) {
          gchar *status;
          status = ibus_m17n_mtext_to_utf8 (m17n->context->status);
@@ -41,6 +41,3 @@ index f23d982..a0dcc70 100644
              IBusText *text;
              text = ibus_text_new_from_string (status);
              ibus_property_set_label (m17n->status_prop, text);
--- 
-1.7.6.4
-
diff --git a/ibus-m17n-virtkbd.patch b/ibus-m17n-virtkbd.patch
index 2ceb043..1a88d2a 100644
--- a/ibus-m17n-virtkbd.patch
+++ b/ibus-m17n-virtkbd.patch
@@ -1,27 +1,21 @@
-From 49d2f16638aaa9160b87936cb89fea92186e5171 Mon Sep 17 00:00:00 2001
+From 98ae1c6dbd279e17ef3c20493a37c959f1b1e61f Mon Sep 17 00:00:00 2001
 From: Daiki Ueno <ueno at unixuser.org>
-Date: Wed, 31 Aug 2011 18:28:48 +0900
-Subject: [PATCH 5/6] Support virtual keyboard.
+Date: Fri, 30 Mar 2012 12:36:08 +0900
+Subject: [PATCH 4/4] Add virtual keyboard support.
 
 ---
- configure.ac                 |   17 +++
- src/Makefile.am              |    7 ++
- src/default.xml.in.in        |  111 ++++++++++++++++++++
- src/engine.c                 |   66 ++++++++++++
- src/ibus-m17n-preferences.ui |   16 +++
- src/m17nutil.c               |   59 +++++++++++-
- src/m17nutil.h               |   11 ++
- src/setup.c                  |   26 +++++
- src/virtkbd.c                |  233 ++++++++++++++++++++++++++++++++++++++++++
- src/virtkbd.h                |   31 ++++++
- 10 files changed, 576 insertions(+), 1 deletions(-)
- create mode 100644 src/virtkbd.c
- create mode 100644 src/virtkbd.h
+ configure.ac          |   17 +++
+ src/Makefile.am       |    5 +
+ src/default.xml.in.in |  111 +++++++++++++++++++
+ src/engine.c          |  289 +++++++++++++++++++++++++++++++++++++++++++++++++
+ src/m17nutil.c        |   10 ++-
+ src/m17nutil.h        |    3 +
+ 6 files changed, 434 insertions(+), 1 deletions(-)
 
-diff --git a/configure.ac b/configure.ac
-index 23102c4..13e42f8 100644
---- a/configure.ac
-+++ b/configure.ac
+Index: ibus-m17n-1.3.4/configure.ac
+===================================================================
+--- ibus-m17n-1.3.4.orig/configure.ac
++++ ibus-m17n-1.3.4/configure.ac
 @@ -88,6 +88,23 @@ fi
  
  AM_CONDITIONAL([HAVE_GTK],[test x$with_gtk != xno])
@@ -46,42 +40,39 @@ index 23102c4..13e42f8 100644
  # check if minput_list, which is available in m17n-lib 1.6.2+ (CVS)
  save_CFLAGS="$CFLAGS"
  save_LIBS="$LIBS"
-diff --git a/src/Makefile.am b/src/Makefile.am
-index e354149..eac6629 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -64,11 +64,18 @@ ibus_engine_m17n_SOURCES = \
- 	main.c \
+Index: ibus-m17n-1.3.4/src/Makefile.am
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/Makefile.am
++++ ibus-m17n-1.3.4/src/Makefile.am
+@@ -65,10 +65,15 @@ ibus_engine_m17n_SOURCES = \
  	engine.c \
  	engine.h \
-+	virtkbd.c \
-+	virtkbd.h \
-+	$(NULL)
+ 	$(NULL)
 +ibus_engine_m17n_CFLAGS = \
 +	@EEKBOARD_CFLAGS@ \
 +	$(AM_CFLAGS) \
- 	$(NULL)
++	$(NULL)
  ibus_engine_m17n_LDADD = \
- 	libm17ncommon.a \
+ 	libm17ncommon.la \
  	@IBUS_LIBS@ \
  	@M17N_LIBS@ \
 +	@EEKBOARD_LIBS@ \
  	$(NULL)
  
  if HAVE_GTK
-diff --git a/src/default.xml.in.in b/src/default.xml.in.in
-index b1c77c5..dfcd978 100644
---- a/src/default.xml.in.in
-+++ b/src/default.xml.in.in
-@@ -12,6 +12,7 @@
+Index: ibus-m17n-1.3.4/src/default.xml.in.in
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/default.xml.in.in
++++ ibus-m17n-1.3.4/src/default.xml.in.in
+@@ -11,6 +11,7 @@
+ 		<rank>0</rank>
  		<preedit-highlight>FALSE</preedit-highlight>
  		<symbol></symbol>
- 		@IBUS_HOTKEYS_XML@
 +		<virtual-keyboard>us</virtual-keyboard>
  	</engine>
- 	<!-- Indic engines should be selected by default:
- 	     https://bugzilla.redhat.com/show_bug.cgi?id=640896 -->
-@@ -410,4 +411,114 @@
+ 	<!-- Blacklist some engines -->
+ 	<!-- kbd engines are duplicate of xkb engines -->
+@@ -440,4 +441,114 @@
  		<name>m17n:zh:tonepy*</name>
  		<symbol>调</symbol>
  	</engine>
@@ -196,23 +187,24 @@ index b1c77c5..dfcd978 100644
 +		<virtual-keyboard>te-inscript,us</virtual-keyboard>
 +	</engine>
  </engines>
-diff --git a/src/engine.c b/src/engine.c
-index dcff0c7..1e6bd1b 100644
---- a/src/engine.c
-+++ b/src/engine.c
-@@ -7,6 +7,7 @@
+Index: ibus-m17n-1.3.4/src/engine.c
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/engine.c
++++ ibus-m17n-1.3.4/src/engine.c
+@@ -7,6 +7,9 @@
  #include <m17n.h>
  #include <string.h>
  #include "m17nutil.h"
-+#include "virtkbd.h"
++#ifdef HAVE_EEKBOARD
++#include <eekboard/eekboard-client.h>
++#endif  /* HAVE_EEKBOARD */
  #include "engine.h"
  
  typedef struct _IBusM17NEngine IBusM17NEngine;
-@@ -18,10 +19,13 @@ struct _IBusM17NEngine {
+@@ -18,10 +21,12 @@ struct _IBusM17NEngine {
      /* members */
      MInputContext *context;
      IBusLookupTable *table;
-+    IBusM17NVirtualKeyboard *virtkbd;
 +
      IBusProperty    *status_prop;
  #ifdef HAVE_SETUP
@@ -222,39 +214,229 @@ index dcff0c7..1e6bd1b 100644
      IBusPropList    *prop_list;
  };
  
-@@ -34,6 +38,8 @@ struct _IBusM17NEngineClass {
-     guint preedit_background;
+@@ -35,9 +40,16 @@ struct _IBusM17NEngineClass {
      gint preedit_underline;
+     IBusPreeditFocusMode preedit_focus_mode;
      gint lookup_table_orientation;
 +    gchar *virtual_keyboard;
-+    gboolean virtual_keyboard_enabled;
  
+     gchar *title;
      MInputMethod *im;
++
++#ifdef HAVE_EEKBOARD
++    EekboardContext *econtext;
++    GSList *keyboards;
++    GSList *keyboards_head;
++#endif  /* HAVE_EEKBOARD */
  };
-@@ -256,6 +262,7 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass)
-     klass->preedit_background = INVALID_COLOR;
-     klass->preedit_underline = IBUS_ATTR_UNDERLINE_NONE;
-     klass->lookup_table_orientation = IBUS_ORIENTATION_SYSTEM;
-+    klass->virtual_keyboard_enabled = FALSE;
  
-     engine_config = ibus_m17n_get_engine_config (engine_name);
-     g_free (engine_name);
-@@ -290,6 +297,14 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass)
-                                    &klass->lookup_table_orientation))
-         klass->lookup_table_orientation = IBUS_ORIENTATION_SYSTEM;
+ /* functions prototype */
+@@ -101,13 +113,184 @@ static IBusEngineClass *parent_class = N
+ 
+ static IBusConfig      *config = NULL;
  
-+    if (!ibus_m17n_config_get_boolean (config,
-+                                       klass->config_section,
-+                                       "virtual_keyboard_enabled",
-+                                       &klass->virtual_keyboard_enabled))
-+        klass->virtual_keyboard_enabled = FALSE;
++#ifdef HAVE_EEKBOARD
++static EekboardClient  *eekboard = NULL;
 +
-+    klass->virtual_keyboard = engine_config->virtual_keyboard;
++static void
++client_destroyed_cb (EekboardClient *client,
++                     gpointer        user_data)
++{
++    if (eekboard) {
++        g_object_unref (eekboard);
++        eekboard = NULL;
++    }
++}
++
++static void
++context_destroyed_cb (EekboardContext *context,
++                      IBusM17NEngineClass *klass)
++{
++    if (klass->econtext) {
++        g_object_unref (klass->econtext);
++        klass->econtext = NULL;
++    }
++}
++
++static EekboardContext *
++create_context (IBusM17NEngineClass *klass)
++{
++    EekboardContext *context = eekboard_client_create_context (eekboard,
++                                                               "ibus-m17n",
++                                                               NULL);
++    g_signal_connect (context, "destroyed",
++                      G_CALLBACK (context_destroyed_cb), klass);
++
++    g_slist_free (klass->keyboards);
++    klass->keyboards = NULL;
++
++    gchar **keyboards = g_strsplit (klass->virtual_keyboard, ",", -1);
++    gchar **p;
++
++    for (p = keyboards; *p; p++) {
++        guint keyboard = eekboard_context_add_keyboard (context,
++                                                        g_strstrip (*p),
++                                                        NULL);
++        klass->keyboards = g_slist_prepend (klass->keyboards,
++                                            GUINT_TO_POINTER (keyboard));
++    }
++    g_strfreev (keyboards);
++
++    klass->keyboards = g_slist_reverse (klass->keyboards);
++    klass->keyboards_head = klass->keyboards;
++
++    eekboard_context_set_keyboard (context,
++                                   GPOINTER_TO_UINT (klass->keyboards_head->data),
++                                   NULL);
++    return context;
++}
++
++static void
++key_activated_cb (EekboardContext *context,
++                  guint            keycode,
++                  EekSymbol       *symbol,
++                  guint            modifiers,
++                  IBusM17NEngine  *m17n)
++{
++    IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
++    IBusEngine *engine = IBUS_ENGINE (m17n);
++
++    if (EEK_IS_TEXT (symbol)) {
++        const gchar *string;
++        IBusText *text;
++
++        string = eek_text_get_text (EEK_TEXT (symbol));
++        text = ibus_text_new_from_static_string (string);
++        ibus_engine_commit_text (engine, text);
++    } else if (EEK_IS_KEYSYM (symbol)) {
++        guint keyval = eek_keysym_get_xkeysym (EEK_KEYSYM (symbol));
++        ibus_engine_forward_key_event (engine,
++                                       keyval,
++                                       0,
++                                       modifiers);
++        ibus_engine_forward_key_event (engine,
++                                       keyval,
++                                       0,
++                                       modifiers | IBUS_RELEASE_MASK);
++    } else if (g_strcmp0 (eek_symbol_get_name (symbol),
++                          "cycle-keyboard") == 0) {
++        klass->keyboards_head = g_slist_next (klass->keyboards_head);
++        if (klass->keyboards_head == NULL)
++            klass->keyboards_head = klass->keyboards;
++        eekboard_context_set_keyboard (klass->econtext,
++                                       GPOINTER_TO_UINT (klass->keyboards_head->data),
++                                       NULL);
++    }
++}
++
++static void
++init_eekboard ()
++{
++    GDBusConnection *connection;
++    GError *error;
++
++    error = NULL;
++    connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
++    if (connection == NULL) {
++        g_printerr ("Can't connect to the session bus: %s\n",
++                    error->message);
++        g_error_free (error);
++        return;
++    }
++
++    eek_init ();
++
++    eekboard = eekboard_client_new (connection, NULL);
++    g_object_unref (connection);
++
++    g_signal_connect (eekboard, "destroyed",
++                      G_CALLBACK (client_destroyed_cb), NULL);
++}
++#endif  /* HAVE_EEKBOARD */
++
++static GType ibus_m17n_virtual_keyboard_implementation_type = 0;
++
++typedef enum {
++    IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_EEKBOARD,
++    IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_IOK
++} IBusM17NVirtualKeyboardImplementation;
++
++#ifdef HAVE_EEKBOARD
++static IBusM17NVirtualKeyboardImplementation virtual_keyboard_implementation =
++    IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_EEKBOARD;
++#else
++static IBusM17NVirtualKeyboardImplementation virtual_keyboard_implementation =
++    IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_IOK;
++#endif
++
+ void
+ ibus_m17n_init (IBusBus *bus)
+ {
++    static const GEnumValue evalues[] = {
++        { IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_EEKBOARD,
++          "IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_EEKBOARD",
++          "eekboard" },
++        { IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_IOK,
++          "IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_IOK",
++          "iok" }
++    };
++
++    GVariant *values;
++
+     config = ibus_bus_get_config (bus);
+     if (config)
+         g_object_ref_sink (config);
+     ibus_m17n_init_common ();
++
++    ibus_m17n_virtual_keyboard_implementation_type =
++        g_enum_register_static ("IBusM17NVirtualKeyboardImplementation",
++                                evalues);
++    values = ibus_config_get_values (config, "engine/M17N");
++    if (values != NULL) {
++        GVariant *value =
++            g_variant_lookup_value (values,
++                                    "virtual_keyboard_implementation",
++                                    G_VARIANT_TYPE_STRING);
++        if (value != NULL) {
++            GEnumClass *eclass = G_ENUM_CLASS (g_type_class_peek (ibus_m17n_virtual_keyboard_implementation_type));
++            GEnumValue *evalue = g_enum_get_value_by_nick (eclass, g_variant_get_string (value, NULL));
++            if (evalue != NULL) {
++                virtual_keyboard_implementation = evalue->value;
++            }
++        }
++    }
 +
++    if (virtual_keyboard_implementation == IBUS_M17N_VIRTUAL_KEYBOARD_IMPLEMENTATION_EEKBOARD) {
++#ifdef HAVE_EEKBOARD
++        init_eekboard ();
++#else
++        g_warning ("eekboard is not supported");
++#endif  /* HAVE_EEKBOARD */
++    }
+ }
+ 
+ static gboolean
+@@ -268,6 +451,7 @@ ibus_m17n_engine_class_init (IBusM17NEng
+         IBUS_ENGINE_PREEDIT_COMMIT :
+         IBUS_ENGINE_PREEDIT_CLEAR;
+     klass->lookup_table_orientation = IBUS_ORIENTATION_SYSTEM;
++    klass->virtual_keyboard = engine_config->virtual_keyboard;
+ 
      ibus_m17n_engine_config_free (engine_config);
  
-     g_signal_connect (config, "value-changed",
-@@ -346,6 +361,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+@@ -317,6 +501,11 @@ ibus_m17n_engine_class_init (IBusM17NEng
+                       klass);
+ 
+     klass->im = NULL;
++
++#if HAVE_EEKBOARD
++    if (eekboard)
++        klass->econtext = create_context (klass);
++#endif  /* HAVE_EEKBOARD */
+ }
+ 
+ static void
+@@ -354,6 +543,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m
  {
      IBusText* label;
      IBusText* tooltip;
@@ -262,12 +444,12 @@ index dcff0c7..1e6bd1b 100644
  
      m17n->prop_list = ibus_prop_list_new ();
      g_object_ref_sink (m17n->prop_list);
-@@ -378,6 +394,24 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n)
+@@ -386,6 +576,36 @@ ibus_m17n_engine_init (IBusM17NEngine *m
      ibus_prop_list_append (m17n->prop_list, m17n->setup_prop);
  #endif  /* HAVE_SETUP */
  
-+    label = ibus_text_new_from_string ("On-screen Keyboard");
-+    tooltip = ibus_text_new_from_string ("Show on-screen keyboard");
++    label = ibus_text_new_from_string ("Screen Keyboard");
++    tooltip = ibus_text_new_from_string ("Show screen keyboard");
 +    m17n->virtkbd_prop = ibus_property_new ("virtual-keyboard",
 +                                            PROP_TYPE_NORMAL,
 +                                            label,
@@ -280,14 +462,26 @@ index dcff0c7..1e6bd1b 100644
 +    g_object_ref_sink (m17n->virtkbd_prop);
 +    ibus_prop_list_append (m17n->prop_list, m17n->virtkbd_prop);
 +
-+    if (klass->virtual_keyboard_enabled &&
-+        klass->virtual_keyboard != NULL)
++#ifdef HAVE_EEKBOARD
++    if (eekboard != NULL)
 +        ibus_property_set_visible (m17n->virtkbd_prop, TRUE);
++    else
++#endif  /* HAVE_EEKBOARD */
++    {
++        gchar *lang = NULL, *name = NULL;
++        if (ibus_m17n_scan_class_name (G_OBJECT_CLASS_NAME (klass),
++                                       &lang,
++                                       &name) &&
++            g_str_has_prefix (name, "inscript"))
++            ibus_property_set_visible (m17n->virtkbd_prop, TRUE);
++        g_free (lang);
++        g_free (name);
++    }
 +
      m17n->table = ibus_lookup_table_new (9, 0, TRUE, TRUE);
      g_object_ref_sink (m17n->table);
      m17n->context = NULL;
-@@ -463,6 +497,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n)
+@@ -471,6 +691,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine
      }
  #endif  /* HAVE_SETUP */
  
@@ -299,119 +493,122 @@ index dcff0c7..1e6bd1b 100644
      if (m17n->table) {
          g_object_unref (m17n->table);
          m17n->table = NULL;
-@@ -473,6 +512,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n)
-         m17n->context = NULL;
-     }
- 
-+    if (m17n->virtkbd) {
-+        g_object_unref (m17n->virtkbd);
-+        m17n->virtkbd = NULL;
-+    }
-+
-     IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)m17n);
- }
- 
-@@ -705,6 +749,9 @@ ibus_m17n_engine_enable (IBusEngine *engine)
+@@ -716,6 +941,14 @@ ibus_m17n_engine_enable (IBusEngine *eng
+     /* Issue a dummy ibus_engine_get_surrounding_text() call to tell
         input context that we will use surrounding-text. */
      ibus_engine_get_surrounding_text (engine, NULL, NULL, NULL);
- #endif  /* HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT */
 +
-+    if (m17n->virtkbd)
-+        ibus_m17n_virtual_keyboard_enable (m17n->virtkbd);
++#ifdef HAVE_EEKBOARD
++    if (eekboard) {
++        IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
++        if (klass->econtext)
++            eekboard_client_push_context (eekboard, klass->econtext, NULL);
++    }
++#endif  /* HAVE_EEKBOARD */
  }
  
  static void
-@@ -714,6 +761,9 @@ ibus_m17n_engine_disable (IBusEngine *engine)
+@@ -725,6 +958,14 @@ ibus_m17n_engine_disable (IBusEngine *en
  
      ibus_m17n_engine_focus_out (engine);
      parent_class->disable (engine);
 +
-+    if (m17n->virtkbd)
-+        ibus_m17n_virtual_keyboard_disable (m17n->virtkbd);
++#ifdef HAVE_EEKBOARD
++    if (eekboard) {
++        IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
++        if (klass->econtext)
++            eekboard_client_pop_context (eekboard, NULL);
++    }
++#endif  /* HAVE_EEKBOARD */
  }
  
  static void
-@@ -776,6 +826,22 @@ ibus_m17n_engine_property_activate (IBusEngine  *engine,
+@@ -772,6 +1013,7 @@ ibus_m17n_engine_property_activate (IBus
+                                     guint        prop_state)
+ {
+     IBusM17NEngine *m17n = (IBusM17NEngine *) engine;
++    IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
+ 
+ #ifdef HAVE_SETUP
+     if (g_strcmp0 (prop_name, "setup") == 0) {
+@@ -787,6 +1029,53 @@ ibus_m17n_engine_property_activate (IBus
      }
  #endif  /* HAVE_SETUP */
  
-+#ifdef HAVE_EEKBOARD
 +    if (g_strcmp0 (prop_name, "virtual-keyboard") == 0) {
-+        /* virtual keyboard is not initialized until a user activates
-+           the "virtual-keyboard" prop for the first time */
-+        if (m17n->virtkbd == NULL) {
-+            IBusM17NEngineClass *klass =
-+                (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
-+            
-+            m17n->virtkbd =
-+                ibus_m17n_virtual_keyboard_new ((IBusEngine *)m17n,
-+                                                klass->virtual_keyboard);
++#ifdef HAVE_EEKBOARD
++        if (eekboard) {
++            if (klass->econtext == NULL) {
++                klass->econtext = create_context (klass);
++                eekboard_client_push_context (eekboard, klass->econtext, NULL);
++            }
++            g_signal_handlers_disconnect_by_func (klass->econtext,
++                                                  G_CALLBACK (key_activated_cb),
++                                                  m17n);
++            g_signal_connect (klass->econtext, "key-activated",
++                              G_CALLBACK (key_activated_cb), m17n);
++            eekboard_context_show_keyboard (klass->econtext, NULL);
++        } else
++#endif  /* HAVE_EEKBOARD */
++        {
++            gchar *lang = NULL, *name = NULL;
++
++            if (ibus_m17n_scan_class_name (G_OBJECT_CLASS_NAME (klass),
++                                           &lang,
++                                           &name) &&
++                g_str_has_prefix (name, "inscript")) {
++                gchar *argv[4];
++                GError *error;
++
++                argv[0] = "iok";
++                argv[1] = "-n";
++                argv[2] = lang;
++                argv[3] = NULL;
++                error = NULL;
++                if (!g_spawn_async (NULL,
++                                    argv,
++                                    NULL,
++                                    G_SPAWN_SEARCH_PATH,
++                                    NULL,
++                                    NULL,
++                                    NULL,
++                                    &error)) {
++                    g_warning ("can't spawn iok: %s", error->message);
++                    g_error_free (error);
++                }
++            }
++            g_free (lang);
++            g_free (name);
 +        }
-+        ibus_m17n_virtual_keyboard_toggle_display (m17n->virtkbd);
 +    }
-+#endif  /*  HAVE_EEKBOARD */
 +
      parent_class->property_activate (engine, prop_name, prop_state);
  }
  
-diff --git a/src/ibus-m17n-preferences.ui b/src/ibus-m17n-preferences.ui
-index a46ab49..bca034d 100644
---- a/src/ibus-m17n-preferences.ui
-+++ b/src/ibus-m17n-preferences.ui
-@@ -192,6 +192,7 @@
-                             <child>
-                               <object class="GtkTable" id="table2">
-                                 <property name="visible">True</property>
-+                                <property name="n_rows">2</property>
-                                 <property name="n_columns">2</property>
-                                 <child>
-                                   <object class="GtkLabel" id="label9">
-@@ -210,6 +211,21 @@
-                                     <property name="right_attach">2</property>
-                                   </packing>
-                                 </child>
-+                                <child>
-+                                  <object class="GtkCheckButton" id="checkbutton_virtkbd">
-+                                    <property name="label" translatable="yes">Enable Virtual Keyboard</property>
-+                                    <property name="visible">True</property>
-+                                    <property name="can_focus">True</property>
-+                                    <property name="receives_default">False</property>
-+                                    <property name="draw_indicator">True</property>
-+                                  </object>
-+                                  <packing>
-+                                    <property name="left_attach">0</property>
-+                                    <property name="right_attach">2</property>
-+                                    <property name="top_attach">1</property>
-+                                    <property name="bottom_attach">2</property>
-+                                  </packing>
-+                                </child>
-                               </object>
-                             </child>
-                           </object>
-diff --git a/src/m17nutil.c b/src/m17nutil.c
-index 94a6891..2143e54 100644
---- a/src/m17nutil.c
-+++ b/src/m17nutil.c
+Index: ibus-m17n-1.3.4/src/m17nutil.c
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/m17nutil.c
++++ ibus-m17n-1.3.4/src/m17nutil.c
 @@ -18,7 +18,8 @@ typedef enum {
-     ENGINE_CONFIG_LAYOUT_MASK = 1 << 1,
-     ENGINE_CONFIG_HOTKEYS_MASK = 1 << 2,
-     ENGINE_CONFIG_SYMBOL_MASK = 1 << 3,
+     ENGINE_CONFIG_SYMBOL_MASK = 1 << 1,
+     ENGINE_CONFIG_LONGNAME_MASK = 1 << 2,
+     ENGINE_CONFIG_LAYOUT_MASK = 1 << 3,
 -    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 4
 +    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 4,
 +    ENGINE_CONFIG_VIRTUAL_KEYBOARD_MASK = 1 << 5
  } EngineConfigMask;
  
  struct _EngineConfigNode {
-@@ -285,6 +286,8 @@ ibus_m17n_get_engine_config (const gchar *engine_name)
-                 config->symbol = cnode->config.symbol;
+@@ -276,6 +277,8 @@ ibus_m17n_get_engine_config (const gchar
+                 config->longname = cnode->config.longname;
              if (cnode->mask & ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK)
                  config->preedit_highlight = cnode->config.preedit_highlight;
 +            if (cnode->mask & ENGINE_CONFIG_VIRTUAL_KEYBOARD_MASK)
 +                config->virtual_keyboard = cnode->config.virtual_keyboard;
+             if (cnode->mask & ENGINE_CONFIG_LAYOUT_MASK)
+                 config->layout = cnode->config.layout;
          }
-     }
-     return config;
-@@ -340,6 +343,11 @@ ibus_m17n_engine_config_parse_xml_node (EngineConfigNode *cnode,
+@@ -333,6 +336,11 @@ ibus_m17n_engine_config_parse_xml_node (
              cnode->mask |= ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK;
              continue;
          }
@@ -423,63 +620,10 @@ index 94a6891..2143e54 100644
          g_warning ("<engine> element contains invalid element <%s>",
                     sub_node->name);
      }
-@@ -494,3 +502,52 @@ ibus_m17n_config_get_int (IBusConfig  *config,
-     return FALSE;
- #endif  /* !IBUS_CHECK_VERSION(1,3,99) */
- }
-+
-+void
-+ibus_m17n_config_set_boolean (IBusConfig  *config,
-+                              const gchar *section,
-+                              const gchar *name,
-+                              gboolean     value)
-+{
-+#if IBUS_CHECK_VERSION(1,3,99)
-+    ibus_config_set_value (config, section, name, g_variant_new_boolean (value));
-+#else
-+    GValue v = { 0 };
-+
-+    g_value_init (&v, G_TYPE_BOOLEAN);
-+    g_value_set_boolean (&v, value);
-+    ibus_config_set_value (config, section, name, &v);
-+#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
-+}
-+
-+gboolean
-+ibus_m17n_config_get_boolean (IBusConfig  *config,
-+                              const gchar *section,
-+                              const gchar *name,
-+                              gboolean    *result)
-+{
-+#if IBUS_CHECK_VERSION(1,3,99)
-+    GVariant *value = NULL;
-+
-+    g_return_val_if_fail (result != NULL, FALSE);
-+
-+    value = ibus_config_get_value (config, section, name);
-+    if (value) {
-+        *result = g_variant_get_boolean (value);
-+        g_variant_unref (value);
-+        return TRUE;
-+    }
-+    return FALSE;
-+#else
-+    GValue value = { 0 };
-+
-+    g_return_val_if_fail (result != NULL, FALSE);
-+
-+    if (ibus_config_get_value (config, section, name, &value)) {
-+        *result = g_value_get_boolean (&value);
-+        g_value_unset (&value);
-+        return TRUE;
-+    }
-+    return FALSE;
-+#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
-+}
-diff --git a/src/m17nutil.h b/src/m17nutil.h
-index 21b1bb9..9c3fca8 100644
---- a/src/m17nutil.h
-+++ b/src/m17nutil.h
+Index: ibus-m17n-1.3.4/src/m17nutil.h
+===================================================================
+--- ibus-m17n-1.3.4.orig/src/m17nutil.h
++++ ibus-m17n-1.3.4/src/m17nutil.h
 @@ -25,6 +25,9 @@ struct _IBusM17NEngineConfig {
  
      /* whether to highlight preedit */
@@ -490,360 +634,3 @@ index 21b1bb9..9c3fca8 100644
  };
  
  typedef struct _IBusM17NEngineConfig IBusM17NEngineConfig;
-@@ -56,4 +59,12 @@ gboolean       ibus_m17n_config_get_int    (IBusConfig  *config,
-                                             const gchar *section,
-                                             const gchar *name,
-                                             gint        *result);
-+void           ibus_m17n_config_set_boolean (IBusConfig  *config,
-+                                             const gchar *section,
-+                                             const gchar *name,
-+                                             gboolean     value);
-+gboolean       ibus_m17n_config_get_boolean (IBusConfig  *config,
-+                                             const gchar *section,
-+                                             const gchar *name,
-+                                             gboolean    *result);
- #endif
-diff --git a/src/setup.c b/src/setup.c
-index 30386df..1c534d6 100644
---- a/src/setup.c
-+++ b/src/setup.c
-@@ -25,6 +25,7 @@ struct _SetupDialog {
-     GtkWidget *colorbutton_foreground;
-     GtkWidget *checkbutton_background;
-     GtkWidget *colorbutton_background;
-+    GtkWidget *checkbutton_virtkbd;
-     GtkWidget *treeview;
-     GtkListStore *store;
- 
-@@ -322,6 +323,15 @@ setup_dialog_load_config (SetupDialog *dialog)
-     gtk_combo_box_set_active (GTK_COMBO_BOX(dialog->combobox_orientation),
-                               index);
- 
-+    if (!ibus_m17n_config_get_boolean (dialog->config,
-+                                       dialog->section,
-+                                       "virtual_keyboard_enabled",
-+                                       &bvalue))
-+        bvalue = FALSE;
-+
-+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(dialog->checkbutton_virtkbd),
-+                                  bvalue);
-+
-     /* Advanced -> m17n-lib configuration */
-     dialog->store = gtk_list_store_new (NUM_COLS,
-                                         G_TYPE_STRING,
-@@ -404,6 +414,17 @@ save_choice (SetupDialog *dialog,
-     ibus_m17n_config_set_int (dialog->config, dialog->section, name, active);
- }
- 
-+static void
-+save_toggle (SetupDialog     *dialog,
-+             GtkToggleButton *togglebutton,
-+             const gchar     *name)
-+{
-+    ibus_m17n_config_set_boolean (dialog->config,
-+                                  dialog->section,
-+                                  name,
-+                                  gtk_toggle_button_get_active (togglebutton));
-+}
-+
- static gboolean
- save_m17n_options (SetupDialog *dialog)
- {
-@@ -486,6 +507,9 @@ setup_dialog_save_config (SetupDialog *dialog)
-     save_choice (dialog,
-                  GTK_COMBO_BOX(dialog->combobox_orientation),
-                  "lookup_table_orientation");
-+    save_toggle (dialog,
-+                 GTK_TOGGLE_BUTTON(dialog->checkbutton_virtkbd),
-+                 "virtual_keyboard_enabled");
-     save_m17n_options (dialog);
- }
- 
-@@ -528,6 +552,8 @@ setup_dialog_new (IBusConfig  *config,
-     dialog->combobox_underline = GTK_WIDGET(object);
-     object = gtk_builder_get_object (builder, "combobox_orientation");
-     dialog->combobox_orientation = GTK_WIDGET(object);
-+    object = gtk_builder_get_object (builder, "checkbutton_virtkbd");
-+    dialog->checkbutton_virtkbd = GTK_WIDGET(object);
-     object = gtk_builder_get_object (builder, "treeview_mim_config");
-     dialog->treeview = GTK_WIDGET(object);
- 
-diff --git a/src/virtkbd.c b/src/virtkbd.c
-new file mode 100644
-index 0000000..9baf971
---- /dev/null
-+++ b/src/virtkbd.c
-@@ -0,0 +1,233 @@
-+/* vim:set et sts=4: */
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#ifdef HAVE_EEKBOARD
-+#include <eekboard/eekboard-client.h>
-+#endif  /* HAVE_EEKBOARD */
-+
-+#include "virtkbd.h"
-+
-+struct _IBusM17NVirtualKeyboard {
-+    GObject parent;
-+    IBusEngine *engine;
-+    gchar *keyboard_type;
-+    GSList *keyboards;
-+
-+#ifdef HAVE_EEKBOARD
-+    EekboardClient *client;
-+    EekboardContext *context;
-+#endif  /* HAVE_EEKBOARD */
-+};
-+
-+struct _IBusM17NVirtualKeyboardClass {
-+    GObjectClass parent_class;
-+};
-+
-+typedef struct _IBusM17NVirtualKeyboardClass IBusM17NVirtualKeyboardClass;
-+
-+#ifdef HAVE_EEKBOARD
-+#define _EEK_INIT() eek_init ()
-+#else
-+#define _EEK_INIT()
-+#endif  /* HAVE_EEKBOARD */
-+
-+G_DEFINE_TYPE_WITH_CODE (IBusM17NVirtualKeyboard, ibus_m17n_virtual_keyboard,
-+                         G_TYPE_OBJECT, _EEK_INIT());
-+
-+static void
-+ibus_m17n_virtual_keyboard_dispose (GObject *object)
-+{
-+    IBusM17NVirtualKeyboard *virtkbd = IBUS_M17N_VIRTUAL_KEYBOARD (object);
-+
-+    if (virtkbd->engine) {
-+        g_object_unref (virtkbd->engine);
-+        virtkbd->engine = NULL;
-+    }
-+    if (virtkbd->keyboards) {
-+        GSList *next = virtkbd->keyboards->next;
-+        /* virtkbd->keyboards is a ring; break it before free */
-+        virtkbd->keyboards->next = NULL;
-+        g_slist_free (next);
-+    }
-+
-+#ifdef HAVE_EEKBOARD
-+    if (virtkbd->context) {
-+        g_object_unref (virtkbd->context);
-+        virtkbd->context = NULL;
-+    }
-+    if (virtkbd->client) {
-+        g_object_unref (virtkbd->client);
-+        virtkbd->client = NULL;
-+    }
-+#endif  /* HAVE_EEKBOARD */
-+
-+    G_OBJECT_CLASS (ibus_m17n_virtual_keyboard_parent_class)->dispose (object);
-+}
-+
-+static void
-+ibus_m17n_virtual_keyboard_finalize (GObject *object)
-+{
-+    IBusM17NVirtualKeyboard *virtkbd = IBUS_M17N_VIRTUAL_KEYBOARD (object);
-+
-+    g_free (virtkbd->keyboard_type);
-+
-+    G_OBJECT_CLASS (ibus_m17n_virtual_keyboard_parent_class)->finalize (object);
-+}
-+
-+static void
-+ibus_m17n_virtual_keyboard_class_init (IBusM17NVirtualKeyboardClass *klass)
-+{
-+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-+    gobject_class->dispose = ibus_m17n_virtual_keyboard_dispose;
-+    gobject_class->finalize = ibus_m17n_virtual_keyboard_finalize;
-+}
-+
-+static void
-+ibus_m17n_virtual_keyboard_init (IBusM17NVirtualKeyboard *self)
-+{
-+}
-+
-+#ifdef HAVE_EEKBOARD
-+static void
-+destroyed_cb (EekboardClient *client,
-+              IBusM17NVirtualKeyboard *virtkbd)
-+{
-+    if (virtkbd->context) {
-+        g_object_unref (virtkbd->context);
-+        virtkbd->context = NULL;
-+    }
-+    if (virtkbd->client) {
-+        g_object_unref (virtkbd->client);
-+        virtkbd->client = NULL;
-+    }
-+}
-+
-+static void
-+key_pressed_cb (EekboardContext *context,
-+                gchar           *keyname,
-+                EekSymbol       *symbol,
-+                guint            modifiers,
-+                IBusM17NVirtualKeyboard *virtkbd)
-+{
-+    if (EEK_IS_TEXT (symbol)) {
-+        const gchar *string;
-+        IBusText *text;
-+
-+        string = eek_text_get_text (EEK_TEXT (symbol));
-+        text = ibus_text_new_from_static_string (string);
-+        ibus_engine_commit_text (virtkbd->engine, text);
-+    } else if (EEK_IS_KEYSYM (symbol)) {
-+        guint keyval = eek_keysym_get_xkeysym (EEK_KEYSYM (symbol));
-+        ibus_engine_forward_key_event (virtkbd->engine,
-+                                       keyval,
-+                                       0,
-+                                       modifiers);
-+        ibus_engine_forward_key_event (virtkbd->engine,
-+                                       keyval,
-+                                       0,
-+                                       modifiers | IBUS_RELEASE_MASK);
-+    } else if (g_strcmp0 (eek_symbol_get_name (symbol),
-+                          "cycle-keyboard") == 0) {
-+        virtkbd->keyboards = g_slist_next (virtkbd->keyboards);
-+        eekboard_context_set_keyboard (virtkbd->context,
-+                                       GPOINTER_TO_UINT (virtkbd->keyboards->data),
-+                                       NULL);
-+    }
-+}
-+
-+static void
-+init_client (IBusM17NVirtualKeyboard *virtkbd)
-+{
-+    GDBusConnection *connection;
-+    GError *error;
-+    gchar **strv, **p;
-+
-+    error = NULL;
-+    connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
-+    if (connection == NULL) {
-+        g_printerr ("Can't connect to the session bus: %s\n",
-+                    error->message);
-+        return;
-+    }
-+
-+    virtkbd->client = eekboard_client_new (connection, NULL);
-+    g_object_unref (connection);
-+    g_signal_connect (virtkbd->client, "destroyed",
-+                      G_CALLBACK (destroyed_cb), virtkbd);
-+
-+    virtkbd->context = eekboard_client_create_context (virtkbd->client,
-+                                                       "ibus-m17n",
-+                                                       NULL);
-+    g_signal_connect (virtkbd->context, "key-pressed",
-+                      G_CALLBACK (key_pressed_cb), virtkbd);
-+
-+    strv = g_strsplit (virtkbd->keyboard_type, ",", -1);
-+    for (p = strv; *p; p++) {
-+        guint keyboard;
-+
-+        keyboard = eekboard_context_add_keyboard (virtkbd->context,
-+                                                  g_strstrip (*p),
-+                                                  NULL);
-+        virtkbd->keyboards = g_slist_prepend (virtkbd->keyboards,
-+                                              GUINT_TO_POINTER (keyboard));
-+    }
-+    virtkbd->keyboards = g_slist_reverse (virtkbd->keyboards);
-+    g_strfreev (strv);
-+
-+    /* make a cycle */
-+    g_slist_last (virtkbd->keyboards)->next = virtkbd->keyboards;
-+
-+    eekboard_context_set_keyboard (virtkbd->context,
-+                                   GPOINTER_TO_UINT (virtkbd->keyboards->data),
-+                                   NULL);
-+}
-+#endif  /* HAVE_EEKBOARD */
-+
-+void
-+ibus_m17n_virtual_keyboard_toggle_display (IBusM17NVirtualKeyboard *virtkbd)
-+{
-+#ifdef HAVE_EEKBOARD
-+    if (virtkbd->client == NULL)
-+        ibus_m17n_virtual_keyboard_enable (virtkbd);
-+
-+    if (virtkbd->client != NULL) {
-+        if (eekboard_context_is_visible (virtkbd->context))
-+            eekboard_context_hide_keyboard (virtkbd->context, NULL);
-+        else
-+            eekboard_context_show_keyboard (virtkbd->context, NULL);
-+    }
-+#endif  /* HAVE_EEKBOARD */
-+}
-+
-+void
-+ibus_m17n_virtual_keyboard_enable (IBusM17NVirtualKeyboard *virtkbd)
-+{
-+#ifdef HAVE_EEKBOARD
-+    if (virtkbd->client == NULL)
-+        init_client (virtkbd);
-+
-+    if (virtkbd->client != NULL)
-+        eekboard_client_push_context (virtkbd->client, virtkbd->context, NULL);
-+#endif  /* HAVE_EEKBOARD */
-+}
-+
-+void
-+ibus_m17n_virtual_keyboard_disable (IBusM17NVirtualKeyboard *virtkbd)
-+{
-+#ifdef HAVE_EEKBOARD
-+    if (virtkbd->client != NULL)
-+        eekboard_client_pop_context (virtkbd->client, NULL);
-+#endif  /* HAVE_EEKBOARD */
-+}
-+
-+IBusM17NVirtualKeyboard *
-+ibus_m17n_virtual_keyboard_new (IBusEngine  *engine,
-+                                const gchar *keyboard_type)
-+{
-+    IBusM17NVirtualKeyboard *virtkbd = g_object_new (IBUS_M17N_TYPE_VIRTUAL_KEYBOARD, NULL);
-+    virtkbd->engine = g_object_ref (engine);
-+    virtkbd->keyboard_type = g_strdup (keyboard_type);
-+    return virtkbd;
-+}
-diff --git a/src/virtkbd.h b/src/virtkbd.h
-new file mode 100644
-index 0000000..c28953a
---- /dev/null
-+++ b/src/virtkbd.h
-@@ -0,0 +1,31 @@
-+#ifndef __VIRTKBD_H__
-+#define __VIRTKBD_H__ 1
-+
-+#include <ibus.h>
-+
-+G_BEGIN_DECLS
-+
-+#define IBUS_M17N_TYPE_VIRTUAL_KEYBOARD (ibus_m17n_virtual_keyboard_get_type())
-+#define IBUS_M17N_VIRTUAL_KEYBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_M17N_TYPE_VIRTUAL_KEYBOARD, IBusM17NVirtualKeyboard))
-+#define IBUS_M17N_VIRTUAL_KEYBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_M17N_TYPE_VIRTUAL_KEYBOARD, IBusM17NVirtualKeyboardClass))
-+#define IBUS_M17N_IS_VIRTUAL_KEYBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_M17N_TYPE_VIRTUAL_KEYBOARD))
-+#define IBUS_M17N_IS_VIRTUAL_KEYBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_M17N_TYPE_VIRTUAL_KEYBOARD))
-+#define IBUS_M17N_VIRTUAL_KEYBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_M17N_TYPE_VIRTUAL_KEYBOARD, IBusM17NVirtualKeyboardClass))
-+
-+typedef struct _IBusM17NVirtualKeyboard IBusM17NVirtualKeyboard;
-+
-+GType                    ibus_m17n_virtual_keyboard_get_type
-+                         (void);
-+IBusM17NVirtualKeyboard *ibus_m17n_virtual_keyboard_new
-+                         (IBusEngine              *engine,
-+                          const gchar             *keyboard_type);
-+void                     ibus_m17n_virtual_keyboard_toggle_display
-+                         (IBusM17NVirtualKeyboard *virtkbd);
-+void                     ibus_m17n_virtual_keyboard_enable
-+                         (IBusM17NVirtualKeyboard *virtkbd);
-+void                     ibus_m17n_virtual_keyboard_disable
-+                         (IBusM17NVirtualKeyboard *virtkbd);
-+
-+G_END_DECLS
-+
-+#endif  /* __VIRTKBD_H__ */
--- 
-1.7.6.2
-
diff --git a/ibus-m17n-xkb-options.patch b/ibus-m17n-xkb-options.patch
index b8f5dd7..a4179ed 100644
--- a/ibus-m17n-xkb-options.patch
+++ b/ibus-m17n-xkb-options.patch
@@ -1,7 +1,7 @@
-From 0cc2abaab50e6668e525da093ef12ed0277d5c21 Mon Sep 17 00:00:00 2001
+From ab9d608fdb6054b4b135f891ad5fa1fa7ce27c7b Mon Sep 17 00:00:00 2001
 From: Daiki Ueno <ueno at unixuser.org>
 Date: Mon, 8 Aug 2011 09:59:28 +0900
-Subject: [PATCH 3/6] Set XKB layout option via default.xml.
+Subject: [PATCH 1/4] Set XKB layout option via default.xml.
 
 ---
  src/default.xml.in.in |    9 +++++++++
@@ -10,10 +10,10 @@ Subject: [PATCH 3/6] Set XKB layout option via default.xml.
  3 files changed, 23 insertions(+), 2 deletions(-)
 
 diff --git a/src/default.xml.in.in b/src/default.xml.in.in
-index dc93fd3..785ab05 100644
+index 9f5a01e..beae494 100644
 --- a/src/default.xml.in.in
 +++ b/src/default.xml.in.in
-@@ -157,6 +157,15 @@
+@@ -158,6 +158,15 @@
  		<name>m17n:si:samanala</name>
  		<rank>0</rank>
  	</engine>
@@ -30,39 +30,39 @@ index dc93fd3..785ab05 100644
  	<engine>
  		<name>m17n:zh:cangjie</name>
 diff --git a/src/m17nutil.c b/src/m17nutil.c
-index b06f71d..201c8b4 100644
+index 51026b2..0b46531 100644
 --- a/src/m17nutil.c
 +++ b/src/m17nutil.c
-@@ -15,7 +15,8 @@ static MConverter *utf8_converter = NULL;
- 
- typedef enum {
+@@ -17,7 +17,8 @@ typedef enum {
      ENGINE_CONFIG_RANK_MASK = 1 << 0,
--    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 1
-+    ENGINE_CONFIG_LAYOUT_MASK = 1 << 1,
-+    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 2
+     ENGINE_CONFIG_SYMBOL_MASK = 1 << 1,
+     ENGINE_CONFIG_LONGNAME_MASK = 1 << 2,
+-    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 3
++    ENGINE_CONFIG_LAYOUT_MASK = 1 << 3,
++    ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 4
  } EngineConfigMask;
  
  struct _EngineConfigNode {
-@@ -130,7 +131,7 @@ ibus_m17n_engine_new (MSymbol  lang,
+@@ -133,7 +134,7 @@ ibus_m17n_engine_new (MSymbol  lang,
                                             "language",    msymbol_name (lang),
                                             "license",     "GPL",
                                             "icon",        engine_icon ? engine_icon : "",
 -                                           "layout",      "us",
 +                                           "layout",      config->layout ? config->layout : "us",
                                             "rank",        config->rank,
-                                            NULL);
- #else
-@@ -272,6 +273,8 @@ ibus_m17n_get_engine_config (const gchar *engine_name)
-         if (g_pattern_match_simple (cnode->name, engine_name)) {
-             if (cnode->mask & ENGINE_CONFIG_RANK_MASK)
-                 config->rank = cnode->config.rank;
-+            if (cnode->mask & ENGINE_CONFIG_LAYOUT_MASK)
-+                config->layout = cnode->config.layout;
+                                            "symbol",      config->symbol ? config->symbol : "",
+                                            "setup",       engine_setup,
+@@ -275,6 +276,8 @@ ibus_m17n_get_engine_config (const gchar *engine_name)
+                 config->longname = cnode->config.longname;
              if (cnode->mask & ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK)
                  config->preedit_highlight = cnode->config.preedit_highlight;
++            if (cnode->mask & ENGINE_CONFIG_LAYOUT_MASK)
++                config->layout = cnode->config.layout;
          }
-@@ -304,6 +307,12 @@ ibus_m17n_engine_config_parse_xml_node (EngineConfigNode *cnode,
-             cnode->mask |= ENGINE_CONFIG_RANK_MASK;
+     }
+     return config;
+@@ -315,6 +318,12 @@ ibus_m17n_engine_config_parse_xml_node (EngineConfigNode *cnode,
+             cnode->mask |= ENGINE_CONFIG_LONGNAME_MASK;
              continue;
          }
 +        if (g_strcmp0 (sub_node->name , "layout") == 0) {
@@ -75,12 +75,12 @@ index b06f71d..201c8b4 100644
              if (g_ascii_strcasecmp ("TRUE", sub_node->text) == 0)
                  cnode->config.preedit_highlight = TRUE;
 diff --git a/src/m17nutil.h b/src/m17nutil.h
-index 313e7bc..c7b283e 100644
+index d790cf8..93faad4 100644
 --- a/src/m17nutil.h
 +++ b/src/m17nutil.h
-@@ -14,6 +14,9 @@ struct _IBusM17NEngineConfig {
-     /* engine rank */
-     gint rank;
+@@ -20,6 +20,9 @@ struct _IBusM17NEngineConfig {
+     /* overridding longname shown on panel */
+     gchar *longname;
  
 +    /* keyboard layout */
 +    gchar *layout;
@@ -89,5 +89,5 @@ index 313e7bc..c7b283e 100644
      gboolean preedit_highlight;
  };
 -- 
-1.7.6.2
+1.7.7.6
 
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index d29791a..8f8302f 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -1,45 +1,36 @@
-%if (0%{?fedora} > 14)
+%if (0%{?fedora} > 14 || 0%{?rhel} > 6)
 %global require_ibus_version 1.3.99.20110817
-%global require_eekboard_version 1.0.3
+%global require_eekboard_version 1.0.6
 %else
 %global require_ibus_version 1.3.0
 %global require_eekboard_version 0.0.6
 %endif
 %global have_bridge_hotkey 0
 
-%if (0%{?fedora} > 14)
+%if (0%{?fedora} > 14 || 0%{?rhel} > 6)
 %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
-
-%if (0%{?fedora} > 16)
+%if (0%{?fedora} > 16 || 0%{?rhel} > 6)
 %global _enable_eekboard --enable-eekboard
 %endif
 
 Name:       ibus-m17n
-Version:    1.3.3
-Release:    7%{?dist}
+Version:    1.3.4
+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-default-xml-override.patch
-Patch2:	    ibus-m17n-setup-refactor.patch
-Patch3:     ibus-m17n-xkb-options.patch
-Patch4:     ibus-m17n-xx-icon-symbol.patch
-Patch5:     ibus-m17n-virtkbd.patch
-Patch6:	    ibus-m17n-iok.patch
-Patch7:	    ibus-m17n-hide-title-status.patch
-Patch8:	    ibus-m17n-blacklist-engines.patch
-Patch9:	    ibus-m17n-custom-setup-element.patch
+# Patch0:     ibus-m17n-HEAD.patch
+Patch1:     ibus-m17n-xkb-options.patch
+Patch2:	    ibus-m17n-hide-title-status.patch
+Patch3:	    ibus-m17n-blacklist-engines.patch
+Patch4:	    ibus-m17n-virtkbd.patch
 
 # The following BR is for autogen and not necessary when packging
 # released tarballs.
@@ -48,12 +39,11 @@ BuildRequires:  libtool
 BuildRequires:  pkgconfig
 BuildRequires:  gnome-common
 BuildRequires:  m17n-lib-devel
-%if (0%{?fedora} > 14)
+%if (0%{?fedora} > 14 || 0%{?rhel} > 6)
 BuildRequires:  gtk3-devel
 %else
 BuildRequires:  gtk2-devel
 %endif
-BuildRequires:  libxklavier-devel
 BuildRequires:  ibus-devel >= %{require_ibus_version}
 BuildRequires:	eekboard-devel >= %{require_eekboard_version}
 
@@ -68,18 +58,13 @@ the input table maps from m17n-db.
 
 %prep
 %setup -q
+
 #patch0 -p1 -b .HEAD
-%patch1 -p1 -b .default-xml-override
-%patch2 -p1 -b .setup-refactor
-%patch3 -p1 -b .xkb-options
-# do not apply patch to m4/.gitignore
-sed -i 's!^[-+][-+][-+] .*/m4/\.gitignore!#\0!' %PATCH4
-%patch4 -p1 -b .xx-icon-symbol
-%patch5 -p1 -b .virtkbd
-%patch6 -p1 -b .iok
-%patch7 -p1 -b .hide-title-status
-%patch8 -p1 -b .blacklist-engines
-%patch9 -p1 -b .custom-setup-element
+%patch1 -p1 -b .xkb-options
+%patch2 -p1 -b .hide-title-status
+%patch3 -p1 -b .blacklist-engines
+%patch4 -p1 -b .virtkbd
+
 NOCONFIGURE=1 ./autogen.sh
 
 %build
@@ -93,7 +78,6 @@ make DESTDIR=${RPM_BUILD_ROOT} install
 %find_lang %{name}
 
 %files -f %{name}.lang
-%defattr(-,root,root,-)
 %doc AUTHORS COPYING README
 %{_datadir}/ibus-m17n
 %{_libexecdir}/ibus-engine-m17n
@@ -101,6 +85,24 @@ make DESTDIR=${RPM_BUILD_ROOT} install
 %{_datadir}/ibus/component/*
 
 %changelog
+* Fri May 11 2012 Daiki Ueno <dueno at redhat.com> - 1.3.4-1
+- New upstream release.
+
+* Tue Apr  3 2012 Daiki Ueno <dueno at redhat.com> - 1.3.3-12
+- Check %%{rhel} version in addition to %%{fedora}
+- Remove unnecessary %%defattr(-,root,root,-) from %%files
+- Drop libxklavier-devel from BR
+
+* Fri Mar 30 2012 Daiki Ueno <dueno at redhat.com> - 1.3.3-11
+- Revive m17n:zh:pinyin with a different label ("hanyu pinyin (m17n)")
+- Rebase ibus-m17n-virtkbd.patch
+
+* Tue Mar  6 2012 Takao Fujiwara <tfujiwar at redhat.com> - 1.3.3-9
+- Rebuild for ibus 1.4.99.20120304
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.3.3-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
 * Tue Dec  6 2011 Daiki Ueno <dueno at redhat.com> - 1.3.3-7
 - Add ibus-m17n-custom-setup-element.patch
 - Fix bug 760427 - engine preferences button in ibus-setup doesn't
diff --git a/sources b/sources
index 8af2da5..b371e33 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-8fa050df5b2d25095d0e2df51946b0de  ibus-m17n-1.3.3.tar.gz
+6f644b73c5943e3c7fb2e02b9e259804  ibus-m17n-1.3.4.tar.gz


More information about the scm-commits mailing list