pkgsrc-Changes archive

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

CVS commit: pkgsrc/inputmethod/fcitx5-skk



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Wed Feb 17 15:26:01 UTC 2021

Added Files:
        pkgsrc/inputmethod/fcitx5-skk: DESCR Makefile PLIST distinfo
        pkgsrc/inputmethod/fcitx5-skk/patches: patch-current-mode-popup.diff

Log Message:
inputmethod/fcitx5-skk: import fcitx5-skk-5.0.3

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


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/inputmethod/fcitx5-skk/DESCR \
    pkgsrc/inputmethod/fcitx5-skk/Makefile \
    pkgsrc/inputmethod/fcitx5-skk/PLIST \
    pkgsrc/inputmethod/fcitx5-skk/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/inputmethod/fcitx5-skk/DESCR
diff -u /dev/null pkgsrc/inputmethod/fcitx5-skk/DESCR:1.1
--- /dev/null   Wed Feb 17 15:26:01 2021
+++ pkgsrc/inputmethod/fcitx5-skk/DESCR Wed Feb 17 15:26:00 2021
@@ -0,0 +1,2 @@
+fcitx5-skk is an input method engine for Fcitx5, which uses libskk
+as its backend.
Index: pkgsrc/inputmethod/fcitx5-skk/Makefile
diff -u /dev/null pkgsrc/inputmethod/fcitx5-skk/Makefile:1.1
--- /dev/null   Wed Feb 17 15:26:01 2021
+++ pkgsrc/inputmethod/fcitx5-skk/Makefile      Wed Feb 17 15:26:00 2021
@@ -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"
Index: pkgsrc/inputmethod/fcitx5-skk/PLIST
diff -u /dev/null pkgsrc/inputmethod/fcitx5-skk/PLIST:1.1
--- /dev/null   Wed Feb 17 15:26:01 2021
+++ pkgsrc/inputmethod/fcitx5-skk/PLIST Wed Feb 17 15:26:00 2021
@@ -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
Index: pkgsrc/inputmethod/fcitx5-skk/distinfo
diff -u /dev/null pkgsrc/inputmethod/fcitx5-skk/distinfo:1.1
--- /dev/null   Wed Feb 17 15:26:01 2021
+++ pkgsrc/inputmethod/fcitx5-skk/distinfo      Wed Feb 17 15:26:00 2021
@@ -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

Index: pkgsrc/inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff
diff -u /dev/null pkgsrc/inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff:1.1
--- /dev/null   Wed Feb 17 15:26:01 2021
+++ pkgsrc/inputmethod/fcitx5-skk/patches/patch-current-mode-popup.diff Wed Feb 17 15:26:01 2021
@@ -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