public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Takao Fujiwara <tfujiwar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ibus] autotool: Add active-surrounding-text property to IBusEngine
Date: Sun, 31 May 2026 02:08:05 GMT [thread overview]
Message-ID: <178019328517.1.10555733529230706094.rpms-ibus-a3f0af08444b@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : a3f0af08444bbeefa892d6d719dfc2cf0efbdf47
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2023-01-25T17:52:16+09:00
Stats : +1226/-25 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/a3f0af08444bbeefa892d6d719dfc2cf0efbdf47?branch=autotool
Log:
Add active-surrounding-text property to IBusEngine
- Refactor surrounding text warning & free focus-id tables
---
diff --git a/ibus-1385349-segv-bus-proxy.patch b/ibus-1385349-segv-bus-proxy.patch
index 093f8fa..098ae58 100644
--- a/ibus-1385349-segv-bus-proxy.patch
+++ b/ibus-1385349-segv-bus-proxy.patch
@@ -1,6 +1,6 @@
-From eb9eaa6b52d5beb4aff0a45dcd2b97a4071029ea Mon Sep 17 00:00:00 2001
+From 5749b4861ffcaf8083d97c6bf9858257373596ce Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 7 Dec 2022 11:11:09 +0900
+Date: Wed, 25 Jan 2023 17:26:47 +0900
Subject: [PATCH] Fix SEGV in bus_panel_proxy_focus_in()
rhbz#1350291 SEGV in BUS_IS_CONNECTION(skip_connection) in
@@ -143,10 +143,10 @@ index 59787a80..af2fbde2 100644
if (incoming) {
/* is incoming message */
diff --git a/bus/engineproxy.c b/bus/engineproxy.c
-index fd1f34fb..57c061ba 100644
+index b3e16066..ba479b59 100644
--- a/bus/engineproxy.c
+++ b/bus/engineproxy.c
-@@ -690,10 +690,12 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
+@@ -693,10 +693,12 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
g_return_if_reached ();
}
@@ -160,7 +160,7 @@ index fd1f34fb..57c061ba 100644
{
GDBusProxyFlags flags;
BusEngineProxy *engine;
-@@ -704,12 +706,20 @@ bus_engine_proxy_new_internal (const gchar *path,
+@@ -706,12 +708,20 @@ bus_engine_proxy_new_internal (const gchar *path,
g_assert (path);
g_assert (IBUS_IS_ENGINE_DESC (desc));
g_assert (G_IS_DBUS_CONNECTION (connection));
@@ -182,7 +182,7 @@ index fd1f34fb..57c061ba 100644
"desc", desc,
"g-connection", connection,
"g-interface-name", IBUS_INTERFACE_ENGINE,
-@@ -717,6 +727,12 @@ bus_engine_proxy_new_internal (const gchar *path,
+@@ -719,6 +729,12 @@ bus_engine_proxy_new_internal (const gchar *path,
"g-default-timeout", g_gdbus_timeout,
"g-flags", flags,
NULL);
@@ -195,15 +195,15 @@ index fd1f34fb..57c061ba 100644
const gchar *layout = ibus_engine_desc_get_layout (desc);
if (layout != NULL && layout[0] != '\0') {
engine->keymap = ibus_keymap_get (layout);
-@@ -736,6 +752,7 @@ bus_engine_proxy_new_internal (const gchar *path,
- }
+@@ -756,6 +772,7 @@ bus_engine_proxy_new_internal (const gchar *path,
+
return engine;
}
+#pragma GCC reset_options
typedef struct {
GTask *task;
-@@ -798,23 +815,30 @@ create_engine_ready_cb (BusFactoryProxy *factory,
+@@ -818,23 +835,30 @@ create_engine_ready_cb (BusFactoryProxy *factory,
GAsyncResult *res,
EngineProxyNewData *data)
{
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index eea15d0..ffb9b37 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -7759,24 +7759,843 @@ index 0c0bda10..340168c8 100644
--
2.38.1
-From b6664195a2bc9c7666f18b5586c538fb671bf1a9 Mon Sep 17 00:00:00 2001
+From d190bc32fe0fe780b66100e5461326973ac7a804 Mon Sep 17 00:00:00 2001
+From: Eberhard Beilharz <eb1@sil.org>
+Date: Thu, 12 Jan 2023 22:24:42 +0900
+Subject: [PATCH 1/3] configure: Fix texts for surrounding text
+
+The options and corresponding texts for surrounding-text were mixed
+up. This change makes them consistent with the text for other
+options.
+
+BUG=https://github.com/ibus/ibus/pull/2438
+---
+ configure.ac | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a84c7130..cba242df 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -633,14 +633,13 @@ AC_SUBST(IBUS_ICON_KEYBOARD)
+ # --disable-surrounding-text option.
+ AC_ARG_ENABLE(surrounding-text,
+ AS_HELP_STRING([--disable-surrounding-text],
+- [Enable surrounding-text support]),
++ [Disable surrounding-text support]),
+ [enable_surrounding_text=$enableval],
+ [enable_surrounding_text=yes]
+ )
+ if test x"$enable_surrounding_text" = x"yes"; then
+ AC_DEFINE(ENABLE_SURROUNDING, TRUE, [Enable surrounding-text support])
+-else
+- enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
++ enable_surrounding_text="yes (enabled, use --disable-surrounding-text to disable)"
+ fi
+
+ # --disable-ui
+--
+2.38.1
+
+From bd24be4582f67e278fc85e843d39b81629bf7d9b Mon Sep 17 00:00:00 2001
+From: Philippe Rouquier <bonfire-app@wanadoo.fr>
+Date: Mon, 23 Jan 2023 21:04:51 +0900
+Subject: [PATCH 2/3] Add active-surrounding-text property to IBusEngine
+
+When this property is set to TRUE, ibus daemon will update
+surrounding text on every focus(in/out) event which makes
+ibus_engine_get_surrounding_text() calls from an engine
+code unnecessary.
+This property must be set at construct time.
+
+BUG=https://github.com/ibus/ibus/pull/2447
+---
+ bus/engineproxy.c | 114 ++++++++++++++++++++++++++++++++++++++--------
+ bus/ibusimpl.c | 16 +++++++
+ bus/ibusimpl.h | 9 ++++
+ src/ibusengine.c | 47 ++++++++++++++++++-
+ 4 files changed, 167 insertions(+), 19 deletions(-)
+
+diff --git a/bus/engineproxy.c b/bus/engineproxy.c
+index fd1f34fb..b3e16066 100644
+--- a/bus/engineproxy.c
++++ b/bus/engineproxy.c
+@@ -60,6 +60,7 @@ struct _BusEngineProxy {
+ /* cached properties */
+ IBusPropList *prop_list;
+ gboolean has_focus_id;
++ gboolean has_active_surrounding_text;
+ };
+
+ struct _BusEngineProxyClass {
+@@ -130,6 +131,8 @@ static void bus_engine_proxy_initable_iface_init
+ *initable_iface);
+ static void bus_engine_proxy_get_has_focus_id
+ (BusEngineProxy *engine);
++static void bus_engine_proxy_get_active_surrounding_text
++ (BusEngineProxy *engine);
+
+ G_DEFINE_TYPE_WITH_CODE (BusEngineProxy, bus_engine_proxy, IBUS_TYPE_PROXY,
+ G_IMPLEMENT_INTERFACE (
+@@ -699,7 +702,6 @@ bus_engine_proxy_new_internal (const gchar *path,
+ BusEngineProxy *engine;
+ BusIBusImpl *ibus = BUS_DEFAULT_IBUS;
+ GHashTable *hash_table = NULL;
+- EngineFocusCategory category = ENGINE_FOCUS_CATEGORY_NONE;
+
+ g_assert (path);
+ g_assert (IBUS_IS_ENGINE_DESC (desc));
+@@ -721,9 +723,12 @@ bus_engine_proxy_new_internal (const gchar *path,
+ if (layout != NULL && layout[0] != '\0') {
+ engine->keymap = ibus_keymap_get (layout);
+ }
+- if (ibus)
+- hash_table = bus_ibus_impl_get_engine_focus_id_table (ibus);
++
++ g_return_val_if_fail (ibus, engine);
++
++ hash_table = bus_ibus_impl_get_engine_focus_id_table (ibus);
+ if (hash_table) {
++ EngineFocusCategory category;
+ category = (EngineFocusCategory)GPOINTER_TO_INT (
+ g_hash_table_lookup (hash_table,
+ ibus_engine_desc_get_name (desc)));
+@@ -734,6 +739,21 @@ bus_engine_proxy_new_internal (const gchar *path,
+ else
+ bus_engine_proxy_get_has_focus_id (engine);
+ }
++
++ hash_table = bus_ibus_impl_get_engine_active_surrounding_text_table (ibus);
++ if (hash_table) {
++ EngineSurroundingTextCategory category;
++ category = (EngineSurroundingTextCategory)GPOINTER_TO_INT (
++ g_hash_table_lookup (hash_table,
++ ibus_engine_desc_get_name (desc)));
++ if (category == ENGINE_SURROUNDING_TEXT_CATEGORY_HAS_ACTIVE)
++ engine->has_active_surrounding_text = TRUE;
++ else if (category == ENGINE_SURROUNDING_TEXT_CATEGORY_NOT_ACTIVE)
++ engine->has_active_surrounding_text = FALSE;
++ else
++ bus_engine_proxy_get_active_surrounding_text (engine);
++ }
++
+ return engine;
+ }
+
+@@ -1263,6 +1283,26 @@ bus_engine_proxy_set_content_type (BusEngineProxy *engine,
+ g_variant_unref (content_type);
+ }
+
++static void
++bus_engine_proxy_get_engine_property (BusEngineProxy *engine,
++ const gchar *prop_name,
++ GAsyncReadyCallback callback,
++ GHashTable *hash_table)
++{
++ g_assert (BUS_IS_ENGINE_PROXY (engine));
++ g_assert (hash_table);
++ g_dbus_proxy_call ((GDBusProxy *) engine,
++ "org.freedesktop.DBus.Properties.Get",
++ g_variant_new ("(ss)",
++ IBUS_INTERFACE_ENGINE,
++ prop_name),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ NULL,
++ callback,
++ g_hash_table_ref (hash_table));
++}
++
+ static void
+ _get_has_focus_id_cb (GObject *object,
+ GAsyncResult *res,
+@@ -1299,23 +1339,57 @@ static void
+ bus_engine_proxy_get_has_focus_id (BusEngineProxy *engine)
+ {
+ BusIBusImpl *ibus = BUS_DEFAULT_IBUS;
+- GHashTable *hash_table;
+-
+- g_assert (BUS_IS_ENGINE_PROXY (engine));
+ g_assert (ibus);
++ bus_engine_proxy_get_engine_property (
++ engine,
++ "FocusId",
++ _get_has_focus_id_cb,
++ bus_ibus_impl_get_engine_focus_id_table (ibus));
++}
+
+- hash_table = bus_ibus_impl_get_engine_focus_id_table (ibus);
+- g_assert (hash_table);
+- g_dbus_proxy_call ((GDBusProxy *) engine,
+- "org.freedesktop.DBus.Properties.Get",
+- g_variant_new ("(ss)",
+- IBUS_INTERFACE_ENGINE,
+- "FocusId"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1,
+- NULL,
+- _get_has_focus_id_cb,
+- g_hash_table_ref (hash_table));
++static void
++_get_active_surrounding_text_cb (GObject *object,
++ GAsyncResult *res,
++ gpointer user_data)
++{
++ GHashTable *hash_table = (GHashTable*)user_data;
++ BusEngineProxy *engine;
++ GError *error = NULL;
++ GVariant *result;
++
++ g_return_if_fail (BUS_IS_ENGINE_PROXY (object));
++ engine = BUS_ENGINE_PROXY (object);
++ result = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error);
++
++ if (result != NULL) {
++ GVariant *variant = NULL;
++ gpointer value;
++ g_variant_get (result, "(v)", &variant);
++ engine->has_active_surrounding_text = g_variant_get_boolean (variant);
++ g_variant_unref (variant);
++ g_variant_unref (result);
++ value = GINT_TO_POINTER (
++ engine->has_active_surrounding_text
++ ? ENGINE_SURROUNDING_TEXT_CATEGORY_HAS_ACTIVE
++ : ENGINE_SURROUNDING_TEXT_CATEGORY_NOT_ACTIVE);
++ g_hash_table_replace (
++ hash_table,
++ (gpointer)ibus_engine_desc_get_name (engine->desc),
++ value);
++ }
++ g_hash_table_unref (hash_table);
++}
++
++static void
++bus_engine_proxy_get_active_surrounding_text (BusEngineProxy *engine)
++{
++ BusIBusImpl *ibus = BUS_DEFAULT_IBUS;
++ g_assert (ibus);
++ bus_engine_proxy_get_engine_property (
++ engine,
++ "ActiveSurroundingText",
++ _get_active_surrounding_text_cb,
++ bus_ibus_impl_get_engine_active_surrounding_text_table (ibus));
+ }
+
+ /* a macro to generate a function to call a nullary D-Bus method. */
+@@ -1348,6 +1422,8 @@ bus_engine_proxy_focus_in (BusEngineProxy *engine,
+ if (engine->has_focus)
+ return;
+ engine->has_focus = TRUE;
++ if (engine->has_active_surrounding_text)
++ g_signal_emit (engine, engine_signals[REQUIRE_SURROUNDING_TEXT], 0);
+ if (engine->has_focus_id) {
+ g_dbus_proxy_call ((GDBusProxy *)engine,
+ "FocusInId",
+@@ -1404,6 +1480,8 @@ bus_engine_proxy_enable (BusEngineProxy *engine)
+ g_assert (BUS_IS_ENGINE_PROXY (engine));
+ if (!engine->enabled) {
+ engine->enabled = TRUE;
++ if (engine->has_active_surrounding_text)
++ g_signal_emit (engine, engine_signals[REQUIRE_SURROUNDING_TEXT], 0);
+ g_dbus_proxy_call ((GDBusProxy *)engine,
+ "Enable",
+ NULL,
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index 8a443545..6df86c3f 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -73,6 +73,7 @@ struct _BusIBusImpl {
+ GHashTable *engine_table;
+
+ GHashTable *engine_focus_id_table;
++ GHashTable *engine_active_surrounding_text_table;
+
+ BusInputContext *focused_context;
+ BusPanelProxy *panel;
+@@ -599,6 +600,8 @@ bus_ibus_impl_init (BusIBusImpl *ibus)
+ ibus->global_engine_name = NULL;
+ ibus->global_previous_engine_name = NULL;
+ ibus->engine_focus_id_table = g_hash_table_new (g_str_hash, g_str_equal);
++ ibus->engine_active_surrounding_text_table = g_hash_table_new (g_str_hash,
++ g_str_equal);
+
+ /* focus the fake_context, if use_global_engine is enabled. */
+ if (ibus->use_global_engine)
+@@ -681,6 +684,11 @@ bus_ibus_impl_destroy (BusIBusImpl *ibus)
+
+ bus_ibus_impl_registry_destroy (ibus);
+
++ if (ibus->engine_active_surrounding_text_table != NULL) {
++ g_hash_table_destroy (ibus->engine_active_surrounding_text_table);
++ ibus->engine_active_surrounding_text_table = NULL;
++ }
++
+ IBUS_OBJECT_CLASS (bus_ibus_impl_parent_class)->destroy (IBUS_OBJECT (ibus));
+ }
+
+@@ -2397,3 +2405,11 @@ bus_ibus_impl_get_engine_focus_id_table (BusIBusImpl *ibus)
+ return ibus->engine_focus_id_table;
+ }
+
++GHashTable *
++bus_ibus_impl_get_engine_active_surrounding_text_table (BusIBusImpl *ibus)
++{
++
++ g_assert (BUS_IS_IBUS_IMPL (ibus));
++
++ return ibus->engine_active_surrounding_text_table;
++}
+diff --git a/bus/ibusimpl.h b/bus/ibusimpl.h
+index cbe6856d..93a854de 100644
+--- a/bus/ibusimpl.h
++++ b/bus/ibusimpl.h
+@@ -66,6 +66,13 @@ typedef enum
+ ENGINE_FOCUS_CATEGORY_HAS_ID
+ } EngineFocusCategory;
+
++typedef enum
++{
++ ENGINE_SURROUNDING_TEXT_CATEGORY_NONE = 0,
++ ENGINE_SURROUNDING_TEXT_CATEGORY_NOT_ACTIVE,
++ ENGINE_SURROUNDING_TEXT_CATEGORY_HAS_ACTIVE
++} EngineSurroundingTextCategory;
++
+ GType bus_ibus_impl_get_type (void);
+
+ /**
+@@ -91,5 +98,7 @@ BusInputContext *bus_ibus_impl_get_focused_input_context
+ (BusIBusImpl *ibus);
+ GHashTable *bus_ibus_impl_get_engine_focus_id_table
+ (BusIBusImpl *ibus);
++GHashTable *bus_ibus_impl_get_engine_active_surrounding_text_table
++ (BusIBusImpl *ibus);
+ G_END_DECLS
+ #endif
+diff --git a/src/ibusengine.c b/src/ibusengine.c
+index 7c797103..cc12ac5a 100644
+--- a/src/ibusengine.c
++++ b/src/ibusengine.c
+@@ -64,6 +64,7 @@ enum {
+ PROP_0,
+ PROP_ENGINE_NAME,
+ PROP_HAS_FOCUS_ID,
++ PROP_ACTIVE_SURROUNDING_TEXT,
+ };
+
+
+@@ -86,6 +87,7 @@ struct _IBusEnginePrivate {
+ gboolean enable_extension;
+ gchar *current_extension_name;
+ gboolean has_focus_id;
++ gboolean has_active_surrounding_text;
+ };
+
+
+@@ -303,6 +305,7 @@ static const gchar introspection_xml[] =
+ /* FIXME properties */
+ " <property name='ContentType' type='(uu)' access='write' />"
+ " <property name='FocusId' type='(b)' access='read' />"
++ " <property name='ActiveSurroundingText' type='(b)' access='read' />"
+ " </interface>"
+ "</node>";
+
+@@ -391,6 +394,23 @@ ibus_engine_class_init (IBusEngineClass *class)
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
++ /**
++ * IBusEngine:active-surrounding-text:
++ *
++ * When this property is set to %TRUE, "RequireSurroundingText" D-Bus
++ * signal will be called by ibus-daemon on every focus-in/out event, with
++ * no need for the engine to call ibus_engine_get_surrounding_text().
++ * This property can only be set at construct time.
++ */
++ g_object_class_install_property (gobject_class,
++ PROP_ACTIVE_SURROUNDING_TEXT,
++ g_param_spec_boolean ("active-surrounding-text",
++ "enable surrounding text update by focus event",
++ "Enable surrounding text update by focus event",
++ FALSE,
++ G_PARAM_READWRITE |
++ G_PARAM_CONSTRUCT_ONLY));
++
+ /* install signals */
+ /**
+ * IBusEngine::process-key-event:
+@@ -988,6 +1008,9 @@ ibus_engine_set_property (IBusEngine *engine,
+ case PROP_HAS_FOCUS_ID:
+ engine->priv->has_focus_id = g_value_get_boolean (value);
+ break;
++ case PROP_ACTIVE_SURROUNDING_TEXT:
++ engine->priv->has_active_surrounding_text = g_value_get_boolean (value);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (engine, prop_id, pspec);
+ }
+@@ -1006,6 +1029,9 @@ ibus_engine_get_property (IBusEngine *engine,
+ case PROP_HAS_FOCUS_ID:
+ g_value_set_boolean (value, engine->priv->has_focus_id);
+ break;
++ case PROP_ACTIVE_SURROUNDING_TEXT:
++ g_value_set_boolean (value, engine->priv->has_active_surrounding_text);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (engine, prop_id, pspec);
+ }
+@@ -1445,6 +1471,24 @@ ibus_engine_service_method_call (IBusService *service,
+ g_return_if_reached ();
+ }
+
++/**
++ * _ibus_engine_get_active_surrounding_text:
++ *
++ * Implement the "ActiveSurroundingText" method call of the
++ * org.freedesktop.IBus interface.
++ */
++static GVariant *
++_ibus_engine_get_active_surrounding_text (IBusEngine *engine,
++ GDBusConnection *connection,
++ GError **error)
++{
++ if (error) {
++ *error = NULL;
++ }
++
++ return g_variant_new_boolean (engine->priv->has_active_surrounding_text);
++}
++
+ /**
+ * _ibus_engine_has_focus_id:
+ *
+@@ -1478,7 +1522,8 @@ ibus_engine_service_get_property (IBusService *service,
+ GDBusConnection *,
+ GError **);
+ } methods [] = {
+- { "FocusId", _ibus_engine_has_focus_id },
++ { "FocusId", _ibus_engine_has_focus_id },
++ { "ActiveSurroundingText", _ibus_engine_get_active_surrounding_text },
+ };
+
+ if (g_strcmp0 (interface_name, IBUS_INTERFACE_ENGINE) != 0) {
+--
+2.38.1
+
+From 2a235c8c33f1de56df4873fe3662d5beb1355715 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 11 Oct 2022 20:12:35 +0900
-Subject: [PATCH] client/gtk2: Refactor surrounding text warning
+Date: Wed, 25 Jan 2023 15:10:50 +0900
+Subject: [PATCH 3/3] Refactor surrounding text warning & free focus-id tables
-It would be better to check the function return value at the
-first calling than the static variable.
+- Free engine_focus_id_table in bus_ibus_impl_destroy
+- It would be better to check the function return value at the
+ first calling than the static variable for the surrounding text
+ warnings
+- Add API comments
Fixes: https://github.com/ibus/ibus/commit/39b6907
Fixes: https://github.com/ibus/ibus/commit/7bbcce6
+Fixes: https://github.com/ibus/ibus/commit/19ca106
+Fixes: https://github.com/ibus/ibus/commit/92771d0
---
- client/gtk2/ibusimcontext.c | 72 +++++++++++++++++++------------------
- 1 file changed, 38 insertions(+), 34 deletions(-)
+ bus/ibusimpl.c | 155 ++++++++++++++++++++----------------
+ client/gtk2/ibusimcontext.c | 76 +++++++++---------
+ src/ibuscomposetable.h | 13 +++
+ src/ibusengine.c | 99 +++++++++++++----------
+ 4 files changed, 196 insertions(+), 147 deletions(-)
+diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
+index 6df86c3f..c2ae88df 100644
+--- a/bus/ibusimpl.c
++++ b/bus/ibusimpl.c
+@@ -2,7 +2,7 @@
+ /* vim:set et sts=4: */
+ /* ibus - The Input Bus
+ * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2011-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2021 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+@@ -287,8 +287,10 @@ bus_ibus_impl_class_init (BusIBusImplClass *class)
+ /**
+ * _panel_destroy_cb:
+ *
+- * A callback function which is called when (1) the connection to the panel process is terminated,
+- * or (2) ibus_proxy_destroy (ibus->panel); is called. See src/ibusproxy.c for details.
++ * A callback function which is called when (1) the connection to the panel
++ * process is terminated,
++ * or (2) ibus_proxy_destroy (ibus->panel); is called. See src/ibusproxy.c for
++ * details.
+ */
+ static void
+ _panel_destroy_cb (BusPanelProxy *panel,
+@@ -360,9 +362,8 @@ bus_ibus_impl_set_panel_extension_keys (BusIBusImpl *ibus,
+ if (ibus->extension_register_keys)
+ g_variant_unref (ibus->extension_register_keys);
+ ibus->extension_register_keys = g_variant_ref_sink (parameters);
+- if (ibus->focused_context != NULL) {
+- engine = bus_input_context_get_engine (ibus->focused_context);
+- }
++ if (ibus->focused_context)
++ engine = bus_input_context_get_engine (ibus->focused_context);
+ if (!engine)
+ return;
+ bus_engine_proxy_panel_extension_register_keys (engine, parameters);
+@@ -429,8 +430,7 @@ _panel_update_auxiliary_text_received_cb (BusPanelProxy *panel,
+
+ if (!ibus->panel)
+ return;
+- bus_panel_proxy_update_auxiliary_text (
+- ibus->panel, text, visible);
++ bus_panel_proxy_update_auxiliary_text (ibus->panel, text, visible);
+ }
+
+ static void
+@@ -443,8 +443,10 @@ _registry_changed_cb (IBusRegistry *registry,
+ /*
+ * _dbus_name_owner_changed_cb:
+ *
+- * A callback function to be called when the name-owner-changed signal is sent to the dbus object.
+- * This usually means a client (e.g. a panel/config/engine process or an application) is connected/disconnected to/from the bus.
++ * A callback function to be called when the name-owner-changed signal is sent
++ * to the dbus object.
++ * This usually means a client (e.g. a panel/config/engine process or an
++ * application) is connected/disconnected to/from the bus.
+ */
+ static void
+ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
+@@ -561,7 +563,8 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
+ /**
+ * bus_ibus_impl_init:
+ *
+- * The constructor of BusIBusImpl. Initialize all member variables of a BusIBusImpl object.
++ * The constructor of #BusIBusImpl. Initialize all member variables of a
++ * #BusIBusImpl object.
+ */
+ static void
+ bus_ibus_impl_init (BusIBusImpl *ibus)
+@@ -645,7 +648,8 @@ bus_ibus_impl_destroy (BusIBusImpl *ibus)
+ if (flag == FALSE) {
+ gpointer old;
+ old = signal (SIGTERM, SIG_IGN);
+- /* send TERM signal to the whole process group (i.e. engines, panel, and config daemon.) */
++ /* send TERM signal to the whole process group (i.e.
++ * engines, panel, and config daemon.) */
+ kill (-getpid (), SIGTERM);
+ signal (SIGTERM, old);
+ flag = TRUE;
+@@ -661,35 +665,29 @@ bus_ibus_impl_destroy (BusIBusImpl *ibus)
+ g_list_free_full (ibus->register_engine_list, g_object_unref);
+ ibus->register_engine_list = NULL;
+
+- if (ibus->factory_dict != NULL) {
+- g_hash_table_destroy (ibus->factory_dict);
+- ibus->factory_dict = NULL;
+- }
++ if (ibus->factory_dict)
++ g_clear_pointer (&ibus->factory_dict, g_hash_table_destroy);
+
+- if (ibus->keymap != NULL) {
+- g_object_unref (ibus->keymap);
+- ibus->keymap = NULL;
+- }
++ if (ibus->keymap)
++ g_clear_pointer (&ibus->keymap, g_object_unref);
+
+- g_free (ibus->global_engine_name);
+- ibus->global_engine_name = NULL;
++ g_clear_pointer (&ibus->global_engine_name, g_free);
++ g_clear_pointer (&ibus->global_previous_engine_name, g_free);
+
+- g_free (ibus->global_previous_engine_name);
+- ibus->global_previous_engine_name = NULL;
+-
+- if (ibus->fake_context) {
+- g_object_unref (ibus->fake_context);
+- ibus->fake_context = NULL;
+- }
++ if (ibus->fake_context)
++ g_clear_pointer (&ibus->fake_context, g_object_unref);
+
+ bus_ibus_impl_registry_destroy (ibus);
+
++ if (ibus->engine_focus_id_table)
++ g_clear_pointer (&ibus->engine_focus_id_table, g_hash_table_destroy);
+ if (ibus->engine_active_surrounding_text_table != NULL) {
+- g_hash_table_destroy (ibus->engine_active_surrounding_text_table);
+- ibus->engine_active_surrounding_text_table = NULL;
++ g_clear_pointer (&ibus->engine_active_surrounding_text_table,
++ g_hash_table_destroy);
+ }
+
+- IBUS_OBJECT_CLASS (bus_ibus_impl_parent_class)->destroy (IBUS_OBJECT (ibus));
++ IBUS_OBJECT_CLASS (bus_ibus_impl_parent_class)->destroy (
++ IBUS_OBJECT (ibus));
+ }
+
+ /**
+@@ -749,7 +747,8 @@ _find_engine_desc_by_name (BusIBusImpl *ibus,
+ /**
+ * _context_request_engine_cb:
+ *
+- * A callback function to be called when the "request-engine" signal is sent to the context.
++ * A callback function to be called when the "request-engine" signal is sent to
++ * the context.
+ */
+ static IBusEngineDesc *
+ _context_request_engine_cb (BusInputContext *context,
+@@ -788,12 +787,13 @@ bus_ibus_impl_set_context_engine_from_desc (BusIBusImpl *ibus,
+ BusInputContext *context,
+ IBusEngineDesc *desc)
+ {
+- bus_input_context_set_engine_by_desc (context,
+- desc,
+- g_gdbus_timeout, /* timeout in msec. */
+- NULL, /* we do not cancel the call. */
+- NULL, /* use the default callback function. */
+- NULL);
++ bus_input_context_set_engine_by_desc (
++ context,
++ desc,
++ g_gdbus_timeout, /* timeout in msec. */
++ NULL, /* we do not cancel the call. */
++ NULL, /* use the default callback function. */
++ NULL);
+ }
+
+ static void
+@@ -827,7 +827,8 @@ bus_ibus_impl_set_focused_context (BusIBusImpl *ibus,
+
+ g_assert (BUS_IS_IBUS_IMPL (ibus));
+ g_assert (context == NULL || BUS_IS_INPUT_CONTEXT (context));
+- g_assert (context == NULL || bus_input_context_get_capabilities (context) & IBUS_CAP_FOCUS);
++ g_assert (context == NULL ||
++ bus_input_context_get_capabilities (context) & IBUS_CAP_FOCUS);
+
+ /* Do noting if it is focused context. */
+ if (ibus->focused_context == context) {
+@@ -938,8 +939,8 @@ bus_ibus_impl_set_global_engine_by_name (BusIBusImpl *ibus,
+ if (!ibus->use_global_engine)
+ return;
+
+- BusInputContext *context =
+- ibus->focused_context != NULL ? ibus->focused_context : ibus->fake_context;
++ BusInputContext *context = ibus->focused_context != NULL
++ ? ibus->focused_context : ibus->fake_context;
+
+ if (context == NULL) {
+ return;
+@@ -1008,7 +1009,8 @@ bus_ibus_impl_check_global_engine (BusIBusImpl *ibus)
+ /**
+ * _context_engine_changed_cb:
+ *
+- * A callback function to be called when the "engine-changed" signal is sent to the context.
++ * A callback function to be called when the "engine-changed" signal is sent to
++ * the context.
+ * Update global engine as well if necessary.
+ */
+ static void
+@@ -1023,7 +1025,8 @@ _context_engine_changed_cb (BusInputContext *context,
+ BusEngineProxy *engine = bus_input_context_get_engine (context);
+ if (engine != NULL) {
+ /* only set global engine if engine is not NULL */
+- const gchar *name = ibus_engine_desc_get_name (bus_engine_proxy_get_desc (engine));
++ const gchar *name = ibus_engine_desc_get_name (
++ bus_engine_proxy_get_desc (engine));
+ if (g_strcmp0 (name, ibus->global_engine_name) == 0)
+ return;
+ g_free (ibus->global_previous_engine_name);
+@@ -1037,8 +1040,10 @@ _context_engine_changed_cb (BusInputContext *context,
+ /**
+ * _context_focus_in_cb:
+ *
+- * A callback function to be called when the "focus-in" signal is sent to the context.
+- * If necessary, enables the global engine on the context and update ibus->focused_context.
++ * A callback function to be called when the "focus-in" signal is sent to the
++ * context.
++ * If necessary, enables the global engine on the context and update
++ * ibus->focused_context.
+ */
+ static void
+ _context_focus_in_cb (BusInputContext *context,
+@@ -1059,7 +1064,8 @@ _context_focus_in_cb (BusInputContext *context,
+ /**
+ * _context_focus_out_cb:
+ *
+- * A callback function to be called when the "focus-out" signal is sent to the context.
++ * A callback function to be called when the "focus-out" signal is sent to the
++ * context.
+ */
+ static void
+ _context_focus_out_cb (BusInputContext *context,
+@@ -1069,7 +1075,8 @@ _context_focus_out_cb (BusInputContext *context,
+ g_assert (BUS_IS_INPUT_CONTEXT (context));
+
+ /* Do noting if context does not support focus.
+- * Actually, the context should emit focus signals, if it does not support focus */
++ * Actually, the context should emit focus signals, if it does not support
++ * focus */
+ if ((bus_input_context_get_capabilities (context) & IBUS_CAP_FOCUS) == 0) {
+ return;
+ }
+@@ -1127,7 +1134,8 @@ bus_ibus_impl_create_input_context (BusIBusImpl *ibus,
+ g_object_ref_sink (context);
+ ibus->contexts = g_list_append (ibus->contexts, context);
+
+- /* Installs glib signal handlers so that the ibus object could be notified when e.g. an IBus.InputContext D-Bus method is called. */
++ /* Installs glib signal handlers so that the ibus object could be notified
++ * when e.g. an IBus.InputContext D-Bus method is called. */
+ static const struct {
+ gchar *name;
+ GCallback callback;
+@@ -1149,7 +1157,8 @@ bus_ibus_impl_create_input_context (BusIBusImpl *ibus,
+
+ bus_input_context_enable (context);
+
+- /* register the context object so that the object could handle IBus.InputContext method calls. */
++ /* register the context object so that the object could handle
++ * IBus.InputContext method calls. */
+ bus_dbus_impl_register_object (BUS_DEFAULT_DBUS,
+ (IBusService *) context);
+ g_object_ref (context);
+@@ -1159,14 +1168,15 @@ bus_ibus_impl_create_input_context (BusIBusImpl *ibus,
+ /**
+ * _ibus_create_input_context:
+ *
+- * Implement the "CreateInputContext" method call of the org.freedesktop.IBus interface.
++ * Implement the "CreateInputContext" method call of the org.freedesktop.IBus
++ * interface.
+ */
+ static void
+ _ibus_create_input_context (BusIBusImpl *ibus,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation)
+ {
+- const gchar *client_name = NULL; // e.g. "gtk-im"
++ const gchar *client_name = NULL; /* e.g. "gtk-im" */
+ g_variant_get (parameters, "(&s)", &client_name);
+
+ BusConnection *connection =
+@@ -1176,9 +1186,11 @@ _ibus_create_input_context (BusIBusImpl *ibus,
+ connection,
+ client_name);
+ if (context) {
+- const gchar *path = ibus_service_get_object_path ((IBusService *) context);
++ const gchar *path =
++ ibus_service_get_object_path ((IBusService *) context);
+ /* the format-string 'o' is for a D-Bus object path. */
+- g_dbus_method_invocation_return_value (invocation, g_variant_new ("(o)", path));
++ g_dbus_method_invocation_return_value (invocation,
++ g_variant_new ("(o)", path));
+ g_object_unref (context);
+ }
+ else {
+@@ -1259,14 +1271,16 @@ _component_destroy_cb (BusComponent *component,
+ g_assert (BUS_IS_IBUS_IMPL (ibus));
+ g_assert (BUS_IS_COMPONENT (component));
+
+- ibus->registered_components = g_list_remove (ibus->registered_components, component);
++ ibus->registered_components = g_list_remove (ibus->registered_components,
++ component);
+
+ /* remove engines from engine_list */
+ GList *engines = bus_component_get_engines (component);
+ GList *p;
+ for (p = engines; p != NULL; p = p->next) {
+ if (g_list_find (ibus->register_engine_list, p->data)) {
+- ibus->register_engine_list = g_list_remove (ibus->register_engine_list, p->data);
++ ibus->register_engine_list =
++ g_list_remove (ibus->register_engine_list, p->data);
+ g_object_unref (p->data);
+ }
+ }
+@@ -1389,7 +1403,8 @@ _ibus_list_engines_depre (BusIBusImpl *ibus,
+ /**
+ * _ibus_get_engines_by_names:
+ *
+- * Implement the "GetEnginesByNames" method call of the org.freedesktop.IBus interface.
++ * Implement the "GetEnginesByNames" method call of the org.freedesktop.IBus
++ * interface.
+ */
+ static void
+ _ibus_get_engines_by_names (BusIBusImpl *ibus,
+@@ -1414,7 +1429,8 @@ _ibus_get_engines_by_names (BusIBusImpl *ibus,
+ "v",
+ ibus_serializable_serialize ((IBusSerializable *)desc));
+ }
+- g_dbus_method_invocation_return_value (invocation, g_variant_new ("(av)", &builder));
++ g_dbus_method_invocation_return_value (invocation,
++ g_variant_new ("(av)", &builder));
+ }
+
+ /**
+@@ -1609,7 +1625,7 @@ _ibus_get_global_engine (BusIBusImpl *ibus,
+
+ GVariant *variant = ibus_serializable_serialize (
+ (IBusSerializable *) desc);
+- // Set type "v" for introspection_xml.
++ /* Set type "v" for introspection_xml. */
+ retval = g_variant_new_variant (variant);
+ if (!retval) {
+ g_set_error (error,
+@@ -1752,12 +1768,13 @@ _ibus_set_global_engine (BusIBusImpl *ibus,
+ SetGlobalEngineData *data = g_slice_new0 (SetGlobalEngineData);
+ data->ibus = g_object_ref (ibus);
+ data->invocation = invocation;
+- bus_input_context_set_engine_by_desc (context,
+- desc,
+- g_gdbus_timeout, /* timeout in msec. */
+- NULL, /* we do not cancel the call. */
+- (GAsyncReadyCallback) _ibus_set_global_engine_ready_cb,
+- data);
++ bus_input_context_set_engine_by_desc (
++ context,
++ desc,
++ g_gdbus_timeout, /* timeout in msec. */
++ NULL, /* we do not cancel the call. */
++ (GAsyncReadyCallback) _ibus_set_global_engine_ready_cb,
++ data);
+ }
+
+ /**
+@@ -2109,19 +2126,17 @@ BusFactoryProxy *
+ bus_ibus_impl_lookup_factory (BusIBusImpl *ibus,
+ const gchar *path)
+ {
+- g_assert (BUS_IS_IBUS_IMPL (ibus));
+-
+ BusFactoryProxy *factory;
+
+- factory = (BusFactoryProxy *) g_hash_table_lookup (ibus->factory_dict, path);
+-
++ g_assert (BUS_IS_IBUS_IMPL (ibus));
++ factory = (BusFactoryProxy *) g_hash_table_lookup (ibus->factory_dict,
++ path);
+ return factory;
+ }
+
+ IBusKeymap *
+ bus_ibus_impl_get_keymap (BusIBusImpl *ibus)
+ {
+-
+ g_assert (BUS_IS_IBUS_IMPL (ibus));
+
+ return ibus->keymap;
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index 6e338157..e4c4ff36 100644
+index 1f3723e6..ea8270bb 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
+@@ -2,8 +2,8 @@
+ /* vim:set et sts=4: */
+ /* ibus - The Input Bus
+ * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+- * Copyright (C) 2008-2022 Red Hat, Inc.
++ * Copyright (C) 2015-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2008-2023 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
@@ -70,7 +70,6 @@ struct _IBusIMContext {
#endif
@@ -7794,7 +8613,7 @@ index 6e338157..e4c4ff36 100644
static void _create_fake_input_context (void);
static gboolean _set_content_type (IBusIMContext *context);
-@@ -565,34 +564,19 @@ _process_key_event (IBusInputContext *context,
+@@ -592,34 +591,19 @@ _process_key_event (IBusInputContext *context,
* context->caps has IBUS_CAP_SURROUNDING_TEXT and the current IBus
* engine needs surrounding-text.
*/
@@ -7832,7 +8651,7 @@ index 6e338157..e4c4ff36 100644
}
static gboolean
-@@ -986,7 +970,6 @@ ibus_im_context_init (GObject *obj)
+@@ -1013,7 +997,6 @@ ibus_im_context_init (GObject *obj)
ibusimcontext->cursor_area.height = 0;
ibusimcontext->ibuscontext = NULL;
@@ -7840,7 +8659,7 @@ index 6e338157..e4c4ff36 100644
ibusimcontext->has_focus = FALSE;
ibusimcontext->time = GDK_CURRENT_TIME;
#ifdef ENABLE_SURROUNDING
-@@ -2185,16 +2168,33 @@ _ibus_context_hide_preedit_text_cb (IBusInputContext *ibuscontext,
+@@ -2212,16 +2195,33 @@ _ibus_context_hide_preedit_text_cb (IBusInputContext *ibuscontext,
g_signal_emit (ibusimcontext, _signal_preedit_end_id, 0);
}
@@ -7878,7 +8697,7 @@ index 6e338157..e4c4ff36 100644
}
static void
-@@ -2236,6 +2236,7 @@ _create_input_context_done (IBusBus *bus,
+@@ -2263,6 +2263,7 @@ _create_input_context_done (IBusBus *bus,
g_error_free (error);
}
else {
@@ -7886,7 +8705,7 @@ index 6e338157..e4c4ff36 100644
ibus_input_context_set_client_commit_preedit (context, TRUE);
ibusimcontext->ibuscontext = context;
-@@ -2263,16 +2264,12 @@ _create_input_context_done (IBusBus *bus,
+@@ -2290,16 +2291,12 @@ _create_input_context_done (IBusBus *bus,
"hide-preedit-text",
G_CALLBACK (_ibus_context_hide_preedit_text_cb),
ibusimcontext);
@@ -7905,7 +8724,7 @@ index 6e338157..e4c4ff36 100644
if (ibusimcontext->has_focus) {
/* The time order is _create_input_context() ->
-@@ -2286,11 +2283,18 @@ _create_input_context_done (IBusBus *bus,
+@@ -2313,11 +2310,18 @@ _create_input_context_done (IBusBus *bus,
_set_cursor_location_internal (ibusimcontext);
if (ibus_input_context_needs_surrounding_text (
ibusimcontext->ibuscontext)) {
@@ -7927,6 +8746,384 @@ index 6e338157..e4c4ff36 100644
if (!g_queue_is_empty (ibusimcontext->events_queue)) {
#if GTK_CHECK_VERSION (3, 98, 4)
+diff --git a/src/ibuscomposetable.h b/src/ibuscomposetable.h
+index be1463ae..32e337f7 100644
+--- a/src/ibuscomposetable.h
++++ b/src/ibuscomposetable.h
+@@ -46,6 +46,8 @@ struct _IBusComposeTable
+ struct _IBusComposeTableEx
+ {
+ IBusComposeTablePrivate *priv;
++ /* @data is const value to accept mmap data and the releasable allocation
++ * is assigned to @rawdata. */
+ const guint16 *data;
+ gint max_seq_len;
+ gint n_seqs;
+@@ -54,6 +56,17 @@ struct _IBusComposeTableEx
+ };
+
+
++/**
++ * ibus_compose_table_new_with_file:
++ * @compose_file: The path of the compose file
++ * @compose_tables: (nullable): The list of other @IBusComposeTableEx
++ * and the generating @IBusComposeTableEx excludes the compose keys
++ * which are included in the other @IBusComposeTableEx.
++ *
++ * Generate @IBusComposeTableEx from the compose file.
++ *
++ * Returns: @IBusComposeTableEx
++ */
+ IBusComposeTableEx *
+ ibus_compose_table_new_with_file (const gchar *compose_file,
+ GSList
+diff --git a/src/ibusengine.c b/src/ibusengine.c
+index cc12ac5a..8aa27b66 100644
+--- a/src/ibusengine.c
++++ b/src/ibusengine.c
+@@ -2,7 +2,7 @@
+ /* vim:set et sts=4: */
+ /* ibus - The Input Bus
+ * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2018-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2018-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2021 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+@@ -371,7 +371,7 @@ ibus_engine_class_init (IBusEngineClass *class)
+
+ /* install properties */
+ /**
+- * IBusEngine:name:
++ * IBusEngine:engine-name:
+ *
+ * Name of this IBusEngine.
+ */
+@@ -385,6 +385,16 @@ ibus_engine_class_init (IBusEngineClass *class)
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
++ /**
++ * IBusEngine:has-focus-id:
++ *
++ * Use #IBusEngine::focus_in_id()/focus_out_id() class method insteads of
++ * focus_in()/focus_out() class methods when this property is set to %TRUE.
++ * Otherwise, use #IBusEngine::focus_in()/focus_out class methods.
++ * This property can only be set at construct time.
++ *
++ * See also: IBusEngine::focus-in-id
++ */
+ g_object_class_install_property (gobject_class,
+ PROP_HAS_FOCUS_ID,
+ g_param_spec_boolean ("has-focus-id",
+@@ -577,7 +587,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * in extended class to receive this signal.
+ *
+ * See also: ibus_input_context_reset().
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[RESET] =
+ g_signal_new (I_("reset"),
+@@ -598,7 +609,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * in extended class to receive this signal.
+ *
+ * See also: ibus_bus_set_global_engine().
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[ENABLE] =
+ g_signal_new (I_("enable"),
+@@ -619,7 +631,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * in extended class to receive this signal.
+ *
+ * See also: ibus_bus_set_global_engine().
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[DISABLE] =
+ g_signal_new (I_("disable"),
+@@ -644,7 +657,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * in extended class to receive this signal.
+ *
+ * See also: ibus_input_context_set_cursor_location().
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[SET_CURSOR_LOCATION] =
+ g_signal_new (I_("set-cursor-location"),
+@@ -670,7 +684,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * in extended class to receive this signal.
+ *
+ * See also: ibus_input_context_set_capabilities().
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[SET_CAPABILITIES] =
+ g_signal_new (I_("set-capabilities"),
+@@ -691,7 +706,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::page_up
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PAGE_UP] =
+ g_signal_new (I_("page-up"),
+@@ -711,7 +727,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::page_down
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PAGE_DOWN] =
+ g_signal_new (I_("page-down"),
+@@ -731,7 +748,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::cursor_up
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[CURSOR_UP] =
+ g_signal_new (I_("cursor-up"),
+@@ -751,7 +769,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::cursor_down
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[CURSOR_DOWN] =
+ g_signal_new (I_("cursor-down"),
+@@ -774,7 +793,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::candidate_clicked
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[CANDIDATE_CLICKED] =
+ g_signal_new (I_("candidate-clicked"),
+@@ -799,7 +819,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::property_activate
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PROPERTY_ACTIVATE] =
+ g_signal_new (I_("property-activate"),
+@@ -822,7 +843,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::property_side
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PROPERTY_SHOW] =
+ g_signal_new (I_("property-show"),
+@@ -844,7 +866,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::property_hide
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PROPERTY_HIDE] =
+ g_signal_new (I_("property-hide"),
+@@ -860,14 +883,16 @@ ibus_engine_class_init (IBusEngineClass *class)
+ /**
+ * IBusEngine::process-hand-writing-event:
+ * @engine: An IBusEngine.
+- * @coordinates: An array of double (0.0 to 1.0) which represents a stroke (i.e. [x1, y1, x2, y2, x3, y3, ...]).
++ * @coordinates: An array of double (0.0 to 1.0) which represents a stroke
++ * (i.e. [x1, y1, x2, y2, x3, y3, ...]).
+ * @coordinates_len: The number of elements in the array.
+ *
+ * Emitted when a hand writing operation is cancelled.
+ * Implement the member function IBusEngineClass::cancel_hand_writing
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[PROCESS_HAND_WRITING_EVENT] =
+ g_signal_new (I_("process-hand-writing-event"),
+@@ -890,7 +915,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * Implement the member function IBusEngineClass::cancel_hand_writing
+ * in extended class to receive this signal.
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[CANCEL_HAND_WRITING] =
+ g_signal_new (I_("cancel-hand-writing"),
+@@ -916,7 +942,8 @@ ibus_engine_class_init (IBusEngineClass *class)
+ * If anchor_pos equals to cursor_pos, it means "there are no selection"
+ * or "does not support selection retrival".
+ *
+- * <note><para>Argument @user_data is ignored in this function.</para></note>
++ * <note><para>Argument @user_data is ignored in this function.</para>
++ * </note>
+ */
+ engine_signals[SET_SURROUNDING_TEXT] =
+ g_signal_new (I_("set-surrounding-text"),
+@@ -1265,7 +1292,8 @@ ibus_engine_service_method_call (IBusService *service,
+ keycode,
+ state);
+ }
+- g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", retval));
++ g_dbus_method_invocation_return_value (invocation,
++ g_variant_new ("(b)", retval));
+ return;
+ }
+ if (g_strcmp0 (method_name, "PanelExtensionReceived") == 0) {
+@@ -1449,8 +1477,10 @@ ibus_engine_service_method_call (IBusService *service,
+
+ coordinates = g_variant_get_fixed_array (g_variant_get_child_value (parameters, 0), &coordinates_len, sizeof (gdouble));
+ g_return_if_fail (coordinates != NULL);
+- g_return_if_fail (coordinates_len >= 4); /* The array should contain at least one line. */
+- g_return_if_fail (coordinates_len <= G_MAXUINT); /* to prevent overflow in the cast in g_signal_emit */
++ /* The array should contain at least one line. */
++ g_return_if_fail (coordinates_len >= 4);
++ /* to prevent overflow in the cast in g_signal_emit */
++ g_return_if_fail (coordinates_len <= G_MAXUINT);
+ g_return_if_fail ((coordinates_len & 1) == 0);
+
+ g_signal_emit (engine, engine_signals[PROCESS_HAND_WRITING_EVENT], 0,
+@@ -1656,38 +1686,32 @@ ibus_engine_set_cursor_location (IBusEngine *engine,
+ gint w,
+ gint h)
+ {
+- // g_debug ("set-cursor-location (%d, %d, %d, %d)", x, y, w, h);
+ }
+
+ static void
+ ibus_engine_set_capabilities (IBusEngine *engine,
+ guint caps)
+ {
+- // g_debug ("set-capabilities (0x%04x)", caps);
+ }
+
+ static void
+ ibus_engine_page_up (IBusEngine *engine)
+ {
+- // g_debug ("page-up");
+ }
+
+ static void
+ ibus_engine_page_down (IBusEngine *engine)
+ {
+- // g_debug ("page-down");
+ }
+
+ static void
+ ibus_engine_cursor_up (IBusEngine *engine)
+ {
+- // g_debug ("cursor-up");
+ }
+
+ static void
+ ibus_engine_cursor_down (IBusEngine *engine)
+ {
+- // g_debug ("cursor-down");
+ }
+
+ static void
+@@ -1696,7 +1720,6 @@ ibus_engine_candidate_clicked (IBusEngine *engine,
+ guint button,
+ guint state)
+ {
+- // g_debug ("candidate-clicked");
+ }
+
+ static void
+@@ -1704,19 +1727,16 @@ ibus_engine_property_activate (IBusEngine *engine,
+ const gchar *prop_name,
+ guint prop_state)
+ {
+- // g_debug ("property-activate ('%s', %d)", prop_name, prop_state);
+ }
+
+ static void
+ ibus_engine_property_show (IBusEngine *engine, const gchar *prop_name)
+ {
+- // g_debug ("property-show ('%s')", prop_name);
+ }
+
+ static void
+ ibus_engine_property_hide (IBusEngine *engine, const gchar *prop_name)
+ {
+- // g_debug ("property-hide ('%s')", prop_name);
+ }
+
+ static void
+@@ -1734,7 +1754,6 @@ ibus_engine_set_surrounding_text (IBusEngine *engine,
+ engine->priv->surrounding_text = (IBusText *) g_object_ref_sink (text ? text : text_empty);
+ engine->priv->surrounding_cursor_pos = cursor_pos;
+ engine->priv->selection_anchor_pos = anchor_pos;
+- // g_debug ("set-surrounding-text ('%s', %d, %d)", text->text, cursor_pos, anchor_pos);
+ }
+
+ static void
+@@ -1742,17 +1761,18 @@ ibus_engine_process_hand_writing_event (IBusEngine *engine,
+ const gdouble *coordinates,
+ guint coordinates_len)
+ {
+- // guint i;
+- // g_debug ("process-hand-writing-event (%u)", coordinates_len);
+- // for (i = 0; i < coordinates_len; i++)
+- // g_debug (" %lf", coordinates[i]);
++#if 0
++ guint i;
++ g_debug ("process-hand-writing-event (%u)", coordinates_len);
++ for (i = 0; i < coordinates_len; i++)
++ g_debug (" %lf", coordinates[i]);
++#endif
+ }
+
+ static void
+ ibus_engine_cancel_hand_writing (IBusEngine *engine,
+ guint n_strokes)
+ {
+- // g_debug ("cancel-hand-writing (%u)", n_strokes);
+ }
+
+ static void
+@@ -1760,7 +1780,6 @@ ibus_engine_set_content_type (IBusEngine *engine,
+ guint purpose,
+ guint hints)
+ {
+- // g_debug ("set-content-type (%u %u)", purpose, hints);
+ }
+
+ static void
+@@ -2085,8 +2104,6 @@ ibus_engine_get_surrounding_text (IBusEngine *engine,
+ ibus_engine_emit_signal (engine,
+ "RequireSurroundingText",
+ NULL);
+-
+- // g_debug ("get-surrounding-text ('%s', %d, %d)", (*text)->text, *cursor_pos, *anchor_pos);
+ }
+
+ void
--
-2.37.3
+2.38.1
diff --git a/ibus.spec b/ibus.spec
index 6f3f0b9..270437c 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -50,7 +50,7 @@
Name: ibus
Version: 1.5.27
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPL-2.0-or-later
URL: https://github.com/ibus/%name/wiki
@@ -558,6 +558,10 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
+* Wed Jan 25 2023 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.27-14
+- Add active-surrounding-text property to IBusEngine
+- Refactor surrounding text warning & free focus-id tables
+
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.27-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
reply other threads:[~2026-05-31 2:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178019328517.1.10555733529230706094.rpms-ibus-a3f0af08444b@fedoraproject.org \
--to=tfujiwar@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox