pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/inputmethod/fcitx5-skk inputmethod/fcitx5-skk: import ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c1301e130557
branches:  trunk
changeset: 447189:c1301e130557
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Wed Feb 17 15:26:00 2021 +0000

description:
inputmethod/fcitx5-skk: import fcitx5-skk-5.0.3

fcitx5-skk is an input method engine for Fcitx5, which uses libskk
as its backend.

diffstat:

 inputmethod/fcitx5-skk/DESCR                                 |    2 +
 inputmethod/fcitx5-skk/Makefile                              |   21 +
 inputmethod/fcitx5-skk/PLIST                                 |   19 +
 inputmethod/fcitx5-skk/distinfo                              |    7 +
 inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff |  135 +++++++++++
 5 files changed, 184 insertions(+), 0 deletions(-)

diffs (204 lines):

diff -r 2902b30e8fa7 -r c1301e130557 inputmethod/fcitx5-skk/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/fcitx5-skk/DESCR      Wed Feb 17 15:26:00 2021 +0000
@@ -0,0 +1,2 @@
+fcitx5-skk is an input method engine for Fcitx5, which uses libskk
+as its backend.
diff -r 2902b30e8fa7 -r c1301e130557 inputmethod/fcitx5-skk/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/fcitx5-skk/Makefile   Wed Feb 17 15:26:00 2021 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1 2021/02/17 15:26:00 ryoon Exp $
+
+DISTNAME=      fcitx5-skk-5.0.3
+CATEGORIES=    inputmethod
+MASTER_SITES=  https://download.fcitx-im.org/fcitx5/fcitx5-skk/
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    ryoon%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/fcitx/fcitx5-skk
+COMMENT=       SKK Kana-Kanji inputmethod for fcitx5
+LICENSE=       gnu-gpl-v3
+
+USE_CMAKE=             yes
+USE_PKGLOCALEDIR=      yes
+USE_LANGUAGES=         c c++
+
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../inputmethod/fcitx5-qt/buildlink3.mk"
+.include "../../inputmethod/libskk/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 2902b30e8fa7 -r c1301e130557 inputmethod/fcitx5-skk/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/fcitx5-skk/PLIST      Wed Feb 17 15:26:00 2021 +0000
@@ -0,0 +1,19 @@
+@comment $NetBSD: PLIST,v 1.1 2021/02/17 15:26:00 ryoon Exp $
+lib/fcitx5/qt5/libfcitx5-skk-config.so
+lib/fcitx5/skk.so
+share/fcitx5/addon/skk.conf
+share/fcitx5/inputmethod/skk.conf
+share/fcitx5/skk/dictionary_list
+share/icons/hicolor/64x64/apps/fcitx-skk.png
+share/icons/hicolor/64x64/apps/org.fcitx.Fcitx5.fcitx-skk.png
+share/locale/ca/LC_MESSAGES/fcitx5-skk.mo
+share/locale/da/LC_MESSAGES/fcitx5-skk.mo
+share/locale/de/LC_MESSAGES/fcitx5-skk.mo
+share/locale/ja/LC_MESSAGES/fcitx5-skk.mo
+share/locale/ko/LC_MESSAGES/fcitx5-skk.mo
+share/locale/ru/LC_MESSAGES/fcitx5-skk.mo
+share/locale/tr/LC_MESSAGES/fcitx5-skk.mo
+share/locale/vi/LC_MESSAGES/fcitx5-skk.mo
+share/locale/zh_CN/LC_MESSAGES/fcitx5-skk.mo
+share/locale/zh_TW/LC_MESSAGES/fcitx5-skk.mo
+share/metainfo/org.fcitx.Fcitx5.Addon.Skk.metainfo.xml
diff -r 2902b30e8fa7 -r c1301e130557 inputmethod/fcitx5-skk/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/fcitx5-skk/distinfo   Wed Feb 17 15:26:00 2021 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2021/02/17 15:26:00 ryoon Exp $
+
+SHA1 (fcitx5-skk-5.0.3.tar.xz) = 772d97d170371788775e74de7b001b196cca1e57
+RMD160 (fcitx5-skk-5.0.3.tar.xz) = 21248a0de443e30ae54e3bf55d62d8091e03dd86
+SHA512 (fcitx5-skk-5.0.3.tar.xz) = a66feb197640b0b49cec604fa1391b9c87f67ed90b884342809a9a07329df006d16d36cc9cf34c0fcf803c5ae83d4d71884224fe2521a9cc81ab7713ba0621bc
+Size (fcitx5-skk-5.0.3.tar.xz) = 36084 bytes
+SHA1 (patch-current-mode-popup.diff) = 7a01774f600ef9db45519aaad5c79602cd311ae5
diff -r 2902b30e8fa7 -r c1301e130557 inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff      Wed Feb 17 15:26:00 2021 +0000
@@ -0,0 +1,135 @@
+$NetBSD: patch-current-mode-popup.diff,v 1.1 2021/02/17 15:26:01 ryoon Exp $
+
+* Add floating status window.
+  From upstream git repo.
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 971a4ff..31310ea 100644
+--- src/CMakeLists.txt
++++ src/CMakeLists.txt
+@@ -12,7 +12,7 @@ target_link_libraries(skk
+ set_target_properties(skk PROPERTIES PREFIX "")
+ install(TARGETS skk DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5")
+ fcitx5_translate_desktop_file(skk.conf.in skk.conf)
+-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/skk.conf" "${CMAKE_CURRENT_BINARY_DIR}/skk.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/fcitx5/inputmethod")
++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/skk.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/fcitx5/inputmethod")
+ fcitx5_translate_desktop_file(skk-addon.conf.in skk-addon.conf)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/skk-addon.conf" RENAME skk.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon")
+ 
+diff --git a/src/skk.conf.in b/src/skk.conf.in
+index 139e557..0a100b3 100644
+--- src/skk.conf.in
++++ src/skk.conf.in
+@@ -3,5 +3,5 @@ Name=Skk
+ Icon=fcitx-skk
+ LangCode=ja
+ Addon=skk
+-Label=skk
++Label=SKK
+ Configurable=True
+diff --git a/src/skk.cpp b/src/skk.cpp
+index a689252..4b92571 100644
+--- src/skk.cpp
++++ src/skk.cpp
+@@ -562,6 +562,7 @@ SkkState::SkkState(SkkEngine *engine, InputContext *ic)
+     skk_context_set_period_style(context, *engine_->config().punctuationStyle);
+     skk_context_set_input_mode(context, *engine_->config().inputMode);
+ 
++    lastMode_ = skk_context_get_input_mode(context);
+     g_signal_connect(context, "notify::input-mode",
+                      G_CALLBACK(SkkState::input_mode_changed_cb), this);
+     g_signal_connect(context, "retrieve_surrounding_text",
+@@ -673,15 +674,14 @@ bool SkkState::handleCandidate(KeyEvent &keyEvent) {
+ }
+ 
+ void SkkState::updateUI() {
+-    auto context = context_.get();
+-
+     auto &inputPanel = ic_->inputPanel();
+-    inputPanel.reset();
++    auto context = context_.get();
+ 
+     SkkCandidateList *skkCandidates = skk_context_get_candidates(context);
++
++    std::unique_ptr<SkkFcitxCandidateList> candidateList;
+     if (skk_candidate_list_get_page_visible(skkCandidates)) {
+-        inputPanel.setCandidateList(
+-            std::make_unique<SkkFcitxCandidateList>(engine_, ic_));
++        candidateList = std::make_unique<SkkFcitxCandidateList>(engine_, ic_);
+     }
+ 
+     if (auto str = UniqueCPtr<char, g_free>{skk_context_poll_output(context)}) {
+@@ -690,6 +690,32 @@ void SkkState::updateUI() {
+         }
+     }
+     Text preedit = skkContextGetPreedit(context);
++
++    // Skk almost filter every key, which makes it calls updateUI on release.
++    // We add an additional check here for checking if the UI is empty or not.
++    // If previous state is empty and the current state is also empty, we'll
++    // ignore the UI update. This makes the input method info not disappear
++    // immediately up key release.
++    bool lastIsEmpty = lastIsEmpty_;
++    bool newIsEmpty = preedit.empty() && !candidateList;
++    lastIsEmpty_ = newIsEmpty;
++
++    // Ensure we are not composing any text.
++    if (modeChanged_ && newIsEmpty) {
++        inputPanel.reset();
++        engine_->instance()->showInputMethodInformation(ic_);
++        return;
++    }
++
++    if (lastIsEmpty && newIsEmpty) {
++        return;
++    }
++
++    inputPanel.reset();
++    if (candidateList) {
++        inputPanel.setCandidateList(std::move(candidateList));
++    }
++
+     if (ic_->capabilityFlags().test(CapabilityFlag::Preedit)) {
+         inputPanel.setClientPreedit(preedit);
+         ic_->updatePreedit();
+@@ -723,11 +749,17 @@ void SkkState::copyTo(InputContextProperty *property) {
+                                skk_context_get_input_mode(context()));
+ }
+ 
+-void SkkState::updateInputMode() { engine_->modeAction()->update(ic_); }
++void SkkState::updateInputMode() {
++    engine_->modeAction()->update(ic_);
++    auto newMode = skk_context_get_input_mode(context());
++    if (lastMode_ != newMode) {
++        lastMode_ = newMode;
++        modeChanged_ = true;
++    }
++}
+ 
+ void SkkState::input_mode_changed_cb(GObject *, GParamSpec *, SkkState *skk) {
+     skk->updateInputMode();
+-    skk->modeChanged_ = true;
+ }
+ 
+ gboolean SkkState::retrieve_surrounding_text_cb(GObject *, gchar **text,
+diff --git a/src/skk.h b/src/skk.h
+index 051dd5c..d0cb401 100644
+--- src/skk.h
++++ src/skk.h
+@@ -142,6 +142,7 @@ class SkkEngine final : public InputMethodEngine {
+ 
+     auto &factory() { return factory_; }
+     auto &config() { return config_; }
++    auto instance() { return instance_; }
+     void setConfig(const RawConfig &config) override {
+         config_.load(config, true);
+         safeSaveAsIni(config_, "conf/skk.conf");
+@@ -213,6 +214,8 @@ class SkkState final : public InputContextProperty {
+     InputContext *ic_;
+     GObjectUniquePtr<SkkContext> context_;
+     bool modeChanged_ = false;
++    SkkInputMode lastMode_ = SKK_INPUT_MODE_DEFAULT;
++    bool lastIsEmpty_ = true;
+ };
+ 
+ } // namespace fcitx



Home | Main Index | Thread Index | Old Index