[packages/ibus-m17n] - updated to 1.4.2 - updated xkb-options patch from Fedora - dropped outdated Fedora iok,xx-icon-sym

qboosh qboosh at pld-linux.org
Sat Apr 25 17:21:01 CEST 2020


commit 869fe0b1291aee7186cf6bee83a3bd58abccb7e4
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Apr 25 17:21:16 2020 +0200

    - updated to 1.4.2
    - updated xkb-options patch from Fedora
    - dropped outdated Fedora iok,xx-icon-symbol patches (withdrawn)

 ibus-m17n-iok.patch            | 100 ----------
 ibus-m17n-xkb-options.patch    | 423 +++++++----------------------------------
 ibus-m17n-xx-icon-symbol.patch | 115 -----------
 ibus-m17n.spec                 |  46 ++---
 4 files changed, 91 insertions(+), 593 deletions(-)
---
diff --git a/ibus-m17n.spec b/ibus-m17n.spec
index 8d592cc..062145d 100644
--- a/ibus-m17n.spec
+++ b/ibus-m17n.spec
@@ -1,34 +1,28 @@
-#
-# Conditional build:
-%bcond_with	bridge_hotkey		# enable the engine hotkeys
-#
 Summary:	The M17N engine for IBus platform
 Summary(pl.UTF-8):	Silnik M17N dla platformy IBus
 Name:		ibus-m17n
-Version:	1.3.4
-Release:	2
+Version:	1.4.2
+Release:	1
 License:	GPL v2+
 Group:		Libraries
 #Source0Download: https://github.com/ibus/ibus-m17n/releases
-Source0:	http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
-# Source0-md5:	6f644b73c5943e3c7fb2e02b9e259804
-Patch0:		%{name}-iok.patch
-Patch1:		%{name}-xkb-options.patch
-Patch2:		%{name}-xx-icon-symbol.patch
+Source0:	https://github.com/ibus/ibus-m17n/releases/download/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	2042a1da9675041a853d6eba7517b212
+Patch0:		%{name}-xkb-options.patch
 URL:		https://github.com/ibus/ibus-m17n
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake >= 1:1.10
-BuildRequires:	gettext-tools >= 0.16.1
-BuildRequires:	gnome-common
+BuildRequires:	gettext-tools >= 0.19
 BuildRequires:	libtool
 BuildRequires:	m17n-lib-devel
-BuildRequires:	pkgconfig
 BuildRequires:	gtk+3-devel >= 3.0
 BuildRequires:	ibus-devel >= 1.4.0
-BuildRequires:	libxklavier-devel
+BuildRequires:	pkgconfig
+BuildRequires:	rpmbuild(macros) >= 1.596
+BuildRequires:	sed >= 4.0
 BuildRequires:	xorg-lib-libX11-devel
+Requires(post,postun):	glib2 >= 1:2.26.0
 Requires:	ibus >= 1.4.0
-Requires:	iok > 1.3.1
 Requires:	m17n-lib
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -46,8 +40,6 @@ z m17n-db.
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -57,26 +49,34 @@ z m17n-db.
 %{__automake}
 %configure \
 	--disable-silent-rules \
-	%{?with_bridge_hotkey:--with-hotkeys} \
 	--with-gtk=3.0
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-# not yet - only single, empty file exists
-#find_lang %{name}
+%find_lang %{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+%post
+%glib_compile_schemas
+
+%postun
+%glib_compile_schemas
+
+%files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc AUTHORS README
 %attr(755,root,root) %{_libexecdir}/ibus-engine-m17n
 %attr(755,root,root) %{_libexecdir}/ibus-setup-m17n
+%{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.engine.m17n.gschema.xml
 %{_datadir}/ibus-m17n
 %{_datadir}/ibus/component/m17n.xml
+%{_datadir}/metainfo/m17n.appdata.xml
+%{_desktopdir}/ibus-setup-m17n.desktop
diff --git a/ibus-m17n-iok.patch b/ibus-m17n-iok.patch
deleted file mode 100644
index e73124f..0000000
--- a/ibus-m17n-iok.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-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;
-+    IBusProperty    *show_iok_prop;
- };
- 
- struct _IBusM17NEngineClass {
-@@ -34,6 +35,7 @@ struct _IBusM17NEngineClass {
-     guint preedit_background;
-     gint preedit_underline;
-     gint lookup_table_orientation;
-+    gboolean use_iok;
- 
-     MInputMethod *im;
- };
-@@ -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);
-+    /* 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);
- 
-@@ -344,6 +349,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m
- {
-     IBusText* label;
-     IBusText* tooltip;
-+    IBusM17NEngineClass *klass = (IBusM17NEngineClass *) G_OBJECT_GET_CLASS (m17n);
- 
-     m17n->prop_list = ibus_prop_list_new ();
-     g_object_ref_sink (m17n->prop_list);
-@@ -376,6 +382,23 @@ 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 ("iok");
-+    m17n->show_iok_prop = ibus_property_new ("iok",
-+                                             PROP_TYPE_NORMAL,
-+                                             label,
-+                                             "/usr/share/pixmaps/iok.xpm",
-+                                             label,
-+                                             TRUE,
-+                                             FALSE,
-+                                             0,
-+                                             NULL);
-+    g_object_ref_sink (m17n->show_iok_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);
-     m17n->context = NULL;
-@@ -461,6 +484,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine
-     }
- #endif  /* HAVE_SETUP */
- 
-+    if (m17n->show_iok_prop) {
-+        g_object_unref (m17n->show_iok_prop);
-+        m17n->show_iok_prop = NULL;
-+    }
-+
-     if (m17n->table) {
-         g_object_unref (m17n->table);
-         m17n->table = NULL;
-@@ -778,6 +806,24 @@ ibus_m17n_engine_property_activate (IBus
-     }
- #endif  /* HAVE_SETUP */
- 
-+    if (g_strcmp0 (prop_name, "iok") == 0) {
-+        const gchar *engine_name;
-+        gchar *lang = NULL, *name = NULL;
-+
-+        engine_name = ibus_engine_get_name ((IBusEngine *) m17n);
-+        if (ibus_m17n_scan_engine_name (engine_name, &lang, &name)) {
-+            gchar *iok;
-+
-+            iok = g_strdup_printf ("/usr/bin/iok -n %s", lang);
-+            g_debug ("keymap name = %s,prop_name=%s, prop_state=%d",
-+                     engine_name, prop_name, prop_state);
-+            g_spawn_command_line_async(iok, NULL);
-+            g_free (iok);
-+        }
-+        g_free (lang);
-+        g_free (name);
-+    }
-+
-     parent_class->property_activate (engine, prop_name, prop_state);
- }
- 
diff --git a/ibus-m17n-xkb-options.patch b/ibus-m17n-xkb-options.patch
index bc0e50a..5e39e44 100644
--- a/ibus-m17n-xkb-options.patch
+++ b/ibus-m17n-xkb-options.patch
@@ -1,366 +1,79 @@
-Patch to set certain XKB options when an m17n IME is set.
-Index: ibus-m17n-1.3.2/configure.ac
+Index: ibus-m17n-1.3.4/src/default.xml
 ===================================================================
---- 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)
---- ibus-m17n-1.3.4/src/Makefile.am.orig	2012-09-16 08:11:40.210367056 +0200
-+++ ibus-m17n-1.3.4/src/Makefile.am	2012-09-16 08:18:31.153691826 +0200
-@@ -65,10 +65,15 @@
- 	engine.c \
- 	engine.h \
- 	$(NULL)
-+ibus_engine_m17n_CFLAGS = \
-+	@LIBXKLAVIER_CFLAGS@ \
-+	$(AM_CFLAGS) \
-+	$(NULL)
- ibus_engine_m17n_LDADD = \
- 	libm17ncommon.la \
- 	@IBUS_LIBS@ \
- 	@M17N_LIBS@ \
-+	@LIBXKLAVIER_LIBS@ \
- 	$(NULL)
- 
- if HAVE_GTK
---- ibus-m17n-1.3.4/src/default.xml.in.in.orig	2012-09-16 08:11:40.210367056 +0200
-+++ ibus-m17n-1.3.4/src/default.xml.in.in	2012-09-16 08:25:48.153682716 +0200
-@@ -73,6 +73,7 @@
- 	<engine>
- 		<name>m17n:si:*</name>
- 		<rank>1</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:ta:*</name>
-@@ -89,16 +90,19 @@
- 		<rank>2</rank>
- 	</engine>
- 	<engine>
--		<name>m17n:bn:inscript</name>
-+		<name>m17n:bn:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
--		<name>m17n:gu:inscript</name>
-+		<name>m17n:gu:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
--		<name>m17n:hi:inscript</name>
-+		<name>m17n:hi:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:kn:kgp</name>
-@@ -109,48 +113,56 @@
- 		<rank>2</rank>
- 	</engine>
- 	<engine>
--		<name>m17n:mai:inscript</name>
-+		<name>m17n:mai:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
--		<name>m17n:ml:inscript</name>
-+		<name>m17n:ml:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
--		<name>m17n:mr:inscript</name>
-+		<name>m17n:mr:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:ne:rom</name>
- 		<rank>2</rank>
- 	</engine>
- 	<engine>
--		<name>m17n:or:inscript</name>
-+		<name>m17n:or:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
--		<name>m17n:pa:inscript</name>
-+		<name>m17n:pa:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:sa:harvard-kyoto</name>
- 		<rank>2</rank>
- 	</engine>
- 	<engine>
--		<name>m17n:sd:inscript</name>
-+		<name>m17n:sd:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:si:wijesekera</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<engine>
- 		<name>m17n:ta:tamil99</name>
- 		<rank>2</rank>
- 	</engine>
- 	<engine>
--		<name>m17n:te:inscript</name>
-+		<name>m17n:te:inscript*</name>
- 		<rank>2</rank>
-+		<xkb-options>lv3:ralt_switch</xkb-options>
- 	</engine>
- 	<!-- Assign lower rank to Sinhala Samanala since it is a
- 	     non-keyboard input method in Sinhala. -->
---- ibus-m17n-1.3.4/src/engine.c.orig	2012-09-16 08:11:40.203700392 +0200
-+++ ibus-m17n-1.3.4/src/engine.c	2012-09-16 08:42:36.946995034 +0200
-@@ -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"
- 
-@@ -39,6 +43,10 @@ struct _IBusM17NEngineClass {
-     gboolean use_iok;
- 
-     MInputMethod *im;
-+
-+#if HAVE_LIBXKLAVIER
-+    XklConfigRec *xkl_config_rec;
-+#endif  /* HAVE_LIBXKLAVIER */
- };
- 
- /* functions prototype */
-@@ -102,12 +110,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 ();
- }
- 
-@@ -316,6 +402,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;
- }
- 
-@@ -417,6 +522,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,
-@@ -504,6 +612,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);
- }
- 
-@@ -739,6 +852,19 @@ 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);
-+
-+#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
-@@ -748,6 +874,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.4.orig/src/default.xml
++++ ibus-m17n-1.3.4/src/default.xml
+@@ -184,6 +184,15 @@
+ 		<name>m17n:si:samanala</name>
+ 		<rank>0</rank>
+ 	</engine>
++	<!-- Some Indic engines expect AltGr is automatically mapped -->
++	<engine>
++		<name>m17n:*:inscript*</name>
++		<layout>default[lv3:ralt_switch]</layout>
++	</engine>
++	<engine>
++		<name>m17n:si:*</name>
++		<layout>default[lv3:ralt_switch]</layout>
++	</engine>
+ 	<!-- Some CJK engines use preedit. -->
+ 	<engine>
+ 		<name>m17n:zh:cangjie</name>
+Index: ibus-m17n-1.3.4/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);
+--- ibus-m17n-1.3.4.orig/src/m17nutil.c
++++ ibus-m17n-1.3.4/src/m17nutil.c
+@@ -17,7 +17,8 @@ typedef enum {
+     ENGINE_CONFIG_RANK_MASK = 1 << 0,
+     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 {
+@@ -137,7 +138,7 @@ ibus_m17n_engine_new (MSymbol  lang,
+                                            "language",    msymbol_name (lang),
+                                            "license",     "GPL",
+                                            "icon",        engine_icon ? engine_icon : "",
+-                                           "layout",      "default",
++                                           "layout",      config->layout ? config->layout : "default",
+                                            "rank",        config->rank,
+                                            "symbol",      config->symbol ? config->symbol : "",
+                                            "setup",       engine_setup,
+@@ -272,6 +273,8 @@ ibus_m17n_get_engine_config (const gchar
+                 config->symbol = cnode->config.symbol;
+             if (cnode->mask & ENGINE_CONFIG_LONGNAME_MASK)
+                 config->longname = cnode->config.longname;
++            if (cnode->mask & ENGINE_CONFIG_LAYOUT_MASK)
++                config->layout = cnode->config.layout;
+             if (cnode->mask & ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK)
+                 config->preedit_highlight = cnode->config.preedit_highlight;
+         }
+@@ -314,6 +317,12 @@ ibus_m17n_engine_config_parse_xml_node (
+             cnode->mask |= ENGINE_CONFIG_LONGNAME_MASK;
              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);
++        if (g_strcmp0 (sub_node->name , "layout") == 0) {
++            g_free (cnode->config.layout);
++            cnode->config.layout = g_strdup (sub_node->text);
++            cnode->mask |= ENGINE_CONFIG_LAYOUT_MASK;
 +            continue;
 +        }
-         g_warning ("<engine> element contains invalid element <%s>",
-                    sub_node->name);
-     }
-Index: ibus-m17n-1.3.2/src/m17nutil.h
+         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.4/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 {
+--- ibus-m17n-1.3.4.orig/src/m17nutil.h
++++ ibus-m17n-1.3.4/src/m17nutil.h
+@@ -20,6 +20,9 @@ struct _IBusM17NEngineConfig {
+     /* overridding longname shown on panel */
+     gchar *longname;
  
++    /* keyboard layout */
++    gchar *layout;
++
      /* 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
deleted file mode 100644
index 03d73dd..0000000
--- a/ibus-m17n-xx-icon-symbol.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-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,9 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GET
- AM_GNU_GETTEXT([external])
- AM_GNU_GETTEXT_VERSION(0.16.1)
- 
-+# hotkeys in component xml
-+IBUS_WITH_HOTKEYS
-+
- 
- # 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)
-+])
---- ibus-m17n-1.3.4/src/default.xml.in.in.orig	2012-09-16 08:53:48.583647692 +0200
-+++ ibus-m17n-1.3.4/src/default.xml.in.in	2012-09-16 09:00:43.100305721 +0200
-@@ -11,6 +11,7 @@
- 		<rank>0</rank>
- 		<preedit-highlight>FALSE</preedit-highlight>
- 		<symbol></symbol>
-+		@IBUS_HOTKEYS_XML@
- 	</engine>
- 	<!-- Indic engines should be selected by default:
- 	     https://bugzilla.redhat.com/show_bug.cgi?id=640896 -->
---- ibus-m17n-1.3.4/src/m17nutil.c.orig	2012-09-16 08:53:48.576981023 +0200
-+++ ibus-m17n-1.3.4/src/m17nutil.c	2012-09-16 10:01:33.243562973 +0200
-@@ -136,6 +136,7 @@ ibus_m17n_engine_new (MSymbol  lang,
-                                            "layout",      "us",
-                                            "rank",        config->rank,
-                                            "symbol",      config->symbol ? config->symbol : "",
-+                                           "hotkeys",     config->hotkeys ? config->hotkeys : "",
-                                            "setup",       engine_setup,
-                                            NULL);
- 
-@@ -310,6 +311,10 @@ ibus_m17n_engine_config_parse_xml_node (
-             cnode->mask |= ENGINE_CONFIG_SYMBOL_MASK;
-             continue;
-         }
-+        if (g_strcmp0 (sub_node->name , "hotkeys") == 0) {
-+            cnode->config.hotkeys = g_strdup (sub_node->text);
-+            continue;
-+        }
-         if (g_strcmp0 (sub_node->name , "longname") == 0) {
-             cnode->config.longname = g_strdup (sub_node->text);
-             cnode->mask |= ENGINE_CONFIG_LONGNAME_MASK;
---- ibus-m17n-1.3.4/src/m17nutil.h.orig	2012-09-16 08:53:48.580314357 +0200
-+++ ibus-m17n-1.3.4/src/m17nutil.h	2012-09-16 09:06:33.490298415 +0200
-@@ -17,6 +17,9 @@ struct _IBusM17NEngineConfig {
-     /* symbol */
-     gchar *symbol;
- 
-+    /* hotkeys */
-+    gchar *hotkeys;
-+
-     /* overridding longname shown on panel */
-     gchar *longname;
- 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ibus-m17n.git/commitdiff/869fe0b1291aee7186cf6bee83a3bd58abccb7e4



More information about the pld-cvs-commit mailing list