ibus-anthy/ibus-anthy-HEAD.patch

369 lines
14 KiB
Diff
Raw Normal View History

2022-01-27 06:55:49 +00:00
From ed993538c711d817e5365630b65f372e0dfd01a7 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 27 Jan 2022 15:15:13 +0900
Subject: [PATCH] data: Update era.t with 2022
---
data/era.t | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/data/era.t b/data/era.t
index a6d297e..686271f 100644
--- a/data/era.t
+++ b/data/era.t
@@ -2,7 +2,7 @@
#
# ibus-anthy - The Anthy engine for IBus
#
-# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -338,6 +338,8 @@
れいわ2 #T35*500 2020
れいわ3 #T35*500 令和3
れいわ3 #T35*500 2021
+れいわ4 #T35*500 令和4
+れいわ4 #T35*500 2022
#T35*500 明治1
#T35*500 明治2
#T35*500 明治3
@@ -496,3 +498,4 @@
#T35*500 平成31
#T35*500 令和2
#T35*500 令和3
+ #T35*500 令和4
--
2.33.1
From 4ef5ac95e84056ebd5a446e5e21b5f2a99377363 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 14 Apr 2022 15:23:26 +0900
Subject: [PATCH] setup: Minimum candidate window page size to 1
IBusLookupTable assert with page_size > 0 (rhbz#2064261)
---
setup/python2/setup.ui | 2 +-
setup/python3/setup.ui | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup/python2/setup.ui b/setup/python2/setup.ui
index 88b19b8..3e82f2e 100644
--- a/setup/python2/setup.ui
+++ b/setup/python2/setup.ui
@@ -2,7 +2,7 @@
<interface>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">10</property>
- <property name="lower">0</property>
+ <property name="lower">1</property>
<property name="page_increment">0</property>
<property name="step_increment">1</property>
<property name="page_size">0</property>
diff --git a/setup/python3/setup.ui b/setup/python3/setup.ui
index 88b19b8..3e82f2e 100644
--- a/setup/python3/setup.ui
+++ b/setup/python3/setup.ui
@@ -2,7 +2,7 @@
<interface>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">10</property>
- <property name="lower">0</property>
+ <property name="lower">1</property>
<property name="page_increment">0</property>
<property name="step_increment">1</property>
<property name="page_size">0</property>
--
2.34.1
From 8cfc210cccbe7324e1fbe7d7911eba33c786a520 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 3 Aug 2022 18:02:02 +0900
Subject: [PATCH] data: Add icon tag in ibus-anthy.appdata.xml.in
---
data/ibus-anthy.appdata.xml.in | 22 +++++
1 files changed, 103 insertions(+), 77 deletions(-)
diff --git a/data/ibus-anthy.appdata.xml.in b/data/ibus-anthy.appdata.xml.in
index 8f246e9..af32a5a 100644
--- a/data/ibus-anthy.appdata.xml.in
+++ b/data/ibus-anthy.appdata.xml.in
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html -->
<component type="inputmethod">
<id>org.freedesktop.ibus.engine.anthy</id>
<metadata_license>GFDL-1.3</metadata_license>
<project_license>GPL-2.0</project_license>
<name translatable="no">Anthy</name>
<summary>Japanese input method</summary>
+ <icon type="remote" width="48" height="48">https://raw.githubusercontent.com/ibus/ibus-anthy/main/icons/ibus-anthy.png</icon>
<description>
<p>
The Anthy input method is designed for entering Japanese text.
@@ -15,9 +17,29 @@
out on a traditional keyboard.
</p>
</description>
+ <keywords>
+ <keyword>input-method</keyword>
+ <keyword>Japanese</keyword>
+ </keywords>
<url type="homepage">https://github.com/ibus/ibus/wiki</url>
<url type="bugtracker">https://github.com/ibus/ibus-anthy/issues</url>
<url type="help">https://github.com/ibus/ibus/wiki/FAQ</url>
+ <url type="translate">https://translate.fedoraproject.org/projects/ibus/ibus-anthy/</url>
+ <releases>
+ <release version="latest">
+ <description>
+ <p>See the upstream release list.</p>
+ </description>
+ <url>https://github.com/ibus/ibus-anthy/releases</url>
+ </release>
+ </releases>
+ <compulsory_for_desktop>IBus</compulsory_for_desktop>
+ <screenshots>
+ <screenshot type="default">
+ <caption>The Anthy input method is designed for entering Japanese text.</caption>
+ <image type="source" width="236" height="200">http://ibus.github.io/images/2.png</image>
+ </screenshot>
+ </screenshots>
<translation type="gettext">ibus-anthy</translation>
<update_contact>tfujiwar_AT_redhat.com</update_contact>
</component>
--
2.35.3
From 8aed07707fba1b7fafed73227916718458409c29 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 3 Aug 2022 07:38:28 +0900
Subject: [PATCH] engine: Enable IBus.Engine::has-focus-id property
IBusEngineClass::has-focus-id propery has been available
since IBus 1.5.27
IBusEngineClass::focus_in_id() class method is used instead of
IBusEngineClass::focus_id() one in case has-focus-id is %TRUE
and object_path and client name are available with the class method.
---
engine/python2/engine.py | 22 +++++++++++++++++-----
engine/python3/engine.py | 22 +++++++++++++++++-----
2 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/engine/python2/engine.py b/engine/python2/engine.py
index 2fb47b5..d97314a 100644
--- a/engine/python2/engine.py
+++ b/engine/python2/engine.py
@@ -4,7 +4,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -127,9 +127,15 @@ class Engine(IBus.EngineSimple):
__latin_with_shift = True
def __init__(self, bus, object_path):
- super(Engine, self).__init__(engine_name="anthy",
- connection=bus.get_connection(),
- object_path=object_path)
+ if hasattr(IBus.Engine.props, 'has_focus_id'):
+ super(Engine, self).__init__(engine_name="anthy",
+ connection=bus.get_connection(),
+ object_path=object_path,
+ has_focus_id=True)
+ else:
+ super(Engine, self).__init__(engine_name="anthy",
+ connection=bus.get_connection(),
+ object_path=object_path)
self.add_table_by_locale(None)
# create anthy context
@@ -1048,6 +1054,12 @@ class Engine(IBus.EngineSimple):
return self.__argb(255, r, g, b)
def do_focus_in(self):
+ self.do_focus_in_id(None, None)
+
+ def do_focus_out(self):
+ self.do_focus_out_id(None)
+
+ def do_focus_in_id(self, object_path, client):
self.register_properties(self.__prop_list)
self.__refresh_typing_mode_property()
mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
@@ -1059,7 +1071,7 @@ class Engine(IBus.EngineSimple):
if size != self.__lookup_table.get_page_size():
self.__lookup_table.set_page_size(size)
- def do_focus_out(self):
+ def do_focus_out_id(self, object_path):
if self.__has_input_purpose:
self.__input_purpose = 0
mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index df4e20d..34b7f9f 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -4,7 +4,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -128,9 +128,15 @@ class Engine(IBus.EngineSimple):
__latin_with_shift = True
def __init__(self, bus, object_path):
- super(Engine, self).__init__(engine_name="anthy",
- connection=bus.get_connection(),
- object_path=object_path)
+ if hasattr(IBus.Engine.props, 'has_focus_id'):
+ super(Engine, self).__init__(engine_name="anthy",
+ connection=bus.get_connection(),
+ object_path=object_path,
+ has_focus_id=True)
+ else:
+ super(Engine, self).__init__(engine_name="anthy",
+ connection=bus.get_connection(),
+ object_path=object_path)
self.add_table_by_locale(None)
# create anthy context
@@ -1043,6 +1049,12 @@ class Engine(IBus.EngineSimple):
return self.__argb(255, r, g, b)
def do_focus_in(self):
+ self.do_focus_in_id(None, None)
+
+ def do_focus_out(self):
+ self.do_focus_out_id(None)
+
+ def do_focus_in_id(self, object_path, client):
self.register_properties(self.__prop_list)
self.__refresh_typing_mode_property()
mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
@@ -1054,7 +1066,7 @@ class Engine(IBus.EngineSimple):
if size != self.__lookup_table.get_page_size():
self.__lookup_table.set_page_size(size)
- def do_focus_out(self):
+ def do_focus_out_id(self, object_path):
if self.__has_input_purpose:
self.__input_purpose = 0
mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
--
2.35.3
From debc427fad513063cf251a1668584a198c692bd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= <fmang@mg0.fr>
Date: Wed, 3 Aug 2022 07:38:59 +0900
Subject: [PATCH] Add the escape_to_latin command as a vi-cooperative cancel (#29)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When writing Japanese in Vim, everytime I switch from Insert mode back to
Normal mode, I need to also switch back the IBus input mode to Latin or
else Vim wont take any of my input. This is kind fo annoying as key
sequences like `<Esc>:w` easily get wired into muscle memory.
For comparison, uim has got a vi-cooperative mode for that use case. See
<https://blog.myon.info/entry/2014/04/14/entry/> for illustration.
Heres a new command which, when converting, behaves like cancel, but
otherwise switches to Latin and sends the Escape key. To make IBus
vi-cooperative, a user can map the Escape key to escape_to_latin instead
of cancel.
---
engine/python2/engine.py | 14 ++++++++++++++
engine/python3/engine.py | 14 ++++++++++++++
setup/python2/anthyprefs.py | 1 +
setup/python3/anthyprefs.py | 1 +
4 files changed, 30 insertions(+)
diff --git a/engine/python2/engine.py b/engine/python2/engine.py
index d97314a..218b485 100644
--- a/engine/python2/engine.py
+++ b/engine/python2/engine.py
@@ -2333,6 +2333,20 @@ class Engine(IBus.EngineSimple):
self.__invalidate()
return True
+ def __cmd_escape_to_latin(self, keyval, state):
+ """
+ Vi-cooperative variant of cancel_all. When Vi users press Escape, they
+ expect to return to Normal mode where an IME would not make sense. This
+ command automatically switches back to Latin when sending Escape. When
+ converting, Escape will cancel the conversion instead.
+ """
+ if self._chk_mode('0'):
+ if Engine.__input_mode != INPUT_MODE_LATIN:
+ self.__cmd_latin_mode(keyval, state)
+ return False
+ else:
+ return self.__cmd_cancel_all(keyval, state)
+
def __cmd_reconvert(self, keyval, state):
if not self.__preedit_ja_string.is_empty():
# if user has inputed some chars
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index 34b7f9f..abb9c02 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -2327,6 +2327,20 @@ class Engine(IBus.EngineSimple):
self.__invalidate()
return True
+ def __cmd_escape_to_latin(self, keyval, state):
+ """
+ Vi-cooperative variant of cancel_all. When Vi users press Escape, they
+ expect to return to Normal mode where an IME would not make sense. This
+ command automatically switches back to Latin when sending Escape. When
+ converting, Escape will cancel the conversion instead.
+ """
+ if self._chk_mode('0'):
+ if Engine.__input_mode != INPUT_MODE_LATIN:
+ self.__cmd_latin_mode(keyval, state)
+ return False
+ else:
+ return self.__cmd_cancel_all(keyval, state)
+
def __cmd_reconvert(self, keyval, state):
if not self.__preedit_ja_string.is_empty():
# if user has inputed some chars
diff --git a/setup/python2/anthyprefs.py b/setup/python2/anthyprefs.py
index 5e3bade..c614491 100644
--- a/setup/python2/anthyprefs.py
+++ b/setup/python2/anthyprefs.py
@@ -276,6 +276,7 @@ _cmd_keys = [
'predict',
'cancel',
'cancel_all',
+ 'escape_to_latin',
'reconvert',
# 'do_nothing',
diff --git a/setup/python3/anthyprefs.py b/setup/python3/anthyprefs.py
index 33b2a31..404aa09 100644
--- a/setup/python3/anthyprefs.py
+++ b/setup/python3/anthyprefs.py
@@ -269,6 +269,7 @@ _cmd_keys = [
'predict',
'cancel',
'cancel_all',
+ 'escape_to_latin',
'reconvert',
# 'do_nothing',
--
2.35.3