From ed993538c711d817e5365630b65f372e0dfd01a7 Mon Sep 17 00:00:00 2001 From: fujiwarat 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 +# Copyright (c) 2010-2022 Takao Fujiwara # 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 1868 #T35*500 明治1 1869 #T35*500 明治2 1870 #T35*500 明治3 @@ -496,3 +498,4 @@ 2019 #T35*500 平成31 2020 #T35*500 令和2 2021 #T35*500 令和3 +2022 #T35*500 令和4 -- 2.33.1 From 4ef5ac95e84056ebd5a446e5e21b5f2a99377363 Mon Sep 17 00:00:00 2001 From: fujiwarat 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 @@ 10 - 0 + 1 0 1 0 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 @@ 10 - 0 + 1 0 1 0 -- 2.34.1 From 8cfc210cccbe7324e1fbe7d7911eba33c786a520 Mon Sep 17 00:00:00 2001 From: fujiwarat 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 @@ + org.freedesktop.ibus.engine.anthy GFDL-1.3 GPL-2.0 Anthy Japanese input method + https://raw.githubusercontent.com/ibus/ibus-anthy/main/icons/ibus-anthy.png

The Anthy input method is designed for entering Japanese text. @@ -15,9 +17,29 @@ out on a traditional keyboard.

+ + input-method + Japanese + https://github.com/ibus/ibus/wiki https://github.com/ibus/ibus-anthy/issues https://github.com/ibus/ibus/wiki/FAQ + https://translate.fedoraproject.org/projects/ibus/ibus-anthy/ + + + +

See the upstream release list.

+
+ https://github.com/ibus/ibus-anthy/releases +
+
+ IBus + + + The Anthy input method is designed for entering Japanese text. + http://ibus.github.io/images/2.png + + ibus-anthy tfujiwar_AT_redhat.com
-- 2.35.3 From 8aed07707fba1b7fafed73227916718458409c29 Mon Sep 17 00:00:00 2001 From: fujiwarat 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 -# Copyright (c) 2010-2021 Takao Fujiwara +# Copyright (c) 2010-2022 Takao Fujiwara # 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 -# Copyright (c) 2010-2021 Takao Fujiwara +# Copyright (c) 2010-2022 Takao Fujiwara # 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?= 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 won’t take any of my input. This is kind fo annoying as key sequences like `:w` easily get wired into muscle memory. For comparison, uim has got a vi-cooperative mode for that use case. See for illustration. Here’s 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 From d1e6853dc4f3cd26b5846b6e4e255bfcaf4e381a Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Thu, 26 Jan 2023 19:11:16 +0900 Subject: [PATCH] engine: Fix page_up/page_down class methods (#27) --- engine/python2/engine.py | 6 +++--- engine/python3/engine.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/python2/engine.py b/engine/python2/engine.py index 218b485..56c0cd5 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 -# Copyright (c) 2010-2022 Takao Fujiwara +# Copyright (c) 2010-2023 Takao Fujiwara # Copyright (c) 2007-2018 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -1536,14 +1536,14 @@ class Engine(IBus.EngineSimple): if self.__preedit_ja_string.is_empty(): return False if self.__lookup_table_visible == True: - self.do_page_up() + self.__page_up(self) return True def __on_key_page_down(self): if self.__preedit_ja_string.is_empty(): return False if self.__lookup_table_visible == True: - self.do_page_down() + self.__page_down(self) return True '''def __on_key_left(self): diff --git a/engine/python3/engine.py b/engine/python3/engine.py index abb9c02..2ebf894 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 -# Copyright (c) 2010-2022 Takao Fujiwara +# Copyright (c) 2010-2023 Takao Fujiwara # Copyright (c) 2007-2018 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -1531,14 +1531,14 @@ class Engine(IBus.EngineSimple): if self.__preedit_ja_string.is_empty(): return False if self.__lookup_table_visible == True: - self.do_page_up() + self.__page_up(self) return True def __on_key_page_down(self): if self.__preedit_ja_string.is_empty(): return False if self.__lookup_table_visible == True: - self.do_page_down() + self.__page_down(self) return True '''def __on_key_left(self): -- 2.38.1 From 227ec140cdf4ffcc4f129f59d9ca7db2076554b2 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Thu, 26 Jan 2023 19:42:25 +0900 Subject: [PATCH] data: Update era.t with 2023 --- data/era.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/era.t b/data/era.t index 686271f..7f7bd1b 100644 --- a/data/era.t +++ b/data/era.t @@ -2,7 +2,7 @@ # # ibus-anthy - The Anthy engine for IBus # -# Copyright (c) 2010-2022 Takao Fujiwara +# Copyright (c) 2010-2023 Takao Fujiwara # Copyright (c) 2010-2013 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -340,6 +340,8 @@ れいわ3 #T35*500 2021 れいわ4 #T35*500 令和4 れいわ4 #T35*500 2022 +れいわ5 #T35*500 令和5 +れいわ5 #T35*500 2023 1868 #T35*500 明治1 1869 #T35*500 明治2 1870 #T35*500 明治3 @@ -499,3 +501,4 @@ 2020 #T35*500 令和2 2021 #T35*500 令和3 2022 #T35*500 令和4 +2023 #T35*500 令和5 -- 2.38.1